Types - Fold
API reference for ./model/fold on @huukhanhnguyen/types.
See the Guide for the package's role.
API reference
Signatures are generated from the live package .d.ts - not hand-written.
BendDirection
type
type BendDirection
// = "up" | "down"BendTag
type
type BendTag
// = {
angle: number;
radius: number;
direction: BendDirection;
kFactor?: number;
profile?: string;
}BendType
type
type BendType
// = "bend" | "crease" | "reverseCrease"FoldPartOptions
type
type FoldPartOptions
// = {
thickness: number;
/** Material's own kFactor (or the arg override) — falls back to
* DEFAULT_K_FACTOR when absent AND no per-bend `.bend.kFactor`. */
kFactor?: number;
foldPolicy?: FoldPolicy;
minFlange?: number;
collisionTolerance?: number;
/** sourceKey -> angle override (degrees), applied to the matching
* tagged curve BEFORE the fold (§2.3c). */
angles?: Record<string, number>;
/** Wood kerf-bend branch activates when BOTH are positive (§2.4). */
kerfWidth?: number;
remainingThickness?: number;
}FoldPartResult
type
type FoldPartResult
// = {
entities: Entity[];
warnings: string[];
}FoldPolicy
type
type FoldPolicy
// = "rigid" | "layered"LinearFoldResult
type
type LinearFoldResult
// = {
entities: ShellEntity[];
warnings: string[];
cutLength: number;
}LinearPartRef
type
The only part metadata this module reads: the key of a CLOSED curve node inside the part's own flat pattern — the cross-section a linear (bar/profile) part sweeps along its centerline. Post VIEW-REFACTOR this arrives as an ordinary component parameter named section (read by Model._partMetaOf — see the convention block there).
type LinearPartRef
// = {
section?: string;
}Separated
type
type Separated
// = {
outerBoundary: CurveEntity;
bends: {
entity: CurveEntity;
type: BendType;
tag: BendTag;
}[];
cuts: CurveEntity[];
}VertexTag
type
type VertexTag
// = {
type: "bend";
radius: number;
}