Skip to content
Shapemetry

@huukhanhnguyen/types / model/fold

model/fold

BendDirection

BendDirection = "up" | "down"


BendTag

BendTag = { angle: number; direction: BendDirection; kFactor?: number; profile?: string; radius: number; }

angle

angle: number

direction

direction: BendDirection

kFactor?

optional kFactor?: number

profile?

optional profile?: string

radius

radius: number


BendType

BendType = "bend" | "crease" | "reverseCrease"


FoldPartOptions

FoldPartOptions = { angles?: Record<string, number>; collisionTolerance?: number; foldPolicy?: FoldPolicy; kerfWidth?: number; kFactor?: number; minFlange?: number; remainingThickness?: number; thickness: number; }

angles?

optional angles?: Record<string, number>

Curve name attribute (authored applyAttribute 'name' '…') -> angle override (degrees), applied to the matching tagged curve BEFORE the fold (§2.3c).

collisionTolerance?

optional collisionTolerance?: number

foldPolicy?

optional foldPolicy?: FoldPolicy

kerfWidth?

optional kerfWidth?: number

Wood kerf-bend branch activates when BOTH are positive (§2.4).

kFactor?

optional kFactor?: number

Material's own kFactor (or the arg override) — falls back to DEFAULT_K_FACTOR when absent AND no per-bend .bend.kFactor.

minFlange?

optional minFlange?: number

remainingThickness?

optional remainingThickness?: number

thickness

thickness: number


FoldPartResult

FoldPartResult = { objects: SceneObject[]; warnings: string[]; }

objects

objects: SceneObject[]

warnings

warnings: string[]


FoldPolicy

FoldPolicy = "rigid" | "layered"


LinearFoldResult

LinearFoldResult = { cutLength: number; data: BrepData; warnings: string[]; }

cutLength

cutLength: number

data

data: BrepData

warnings

warnings: string[]


LinearPartRef

LinearPartRef = { section?: string; }

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).

section?

optional section?: string


Separated

Separated = { bends: { curve: PolyCurve; name: string; tag: BendTag; type: BendType; }[]; cuts: PolyCurve[]; outerBoundary: PolyCurve; }

bends

bends: { curve: PolyCurve; name: string; tag: BendTag; type: BendType; }[]

name is the curve's own name attribute (authored applyAttribute 'name' '…', the same one FoldPartOptions.angles keys on) — every fold error naming the offending bend reads it. "?" when the author left the curve unnamed.

curve

curve: PolyCurve

name

name: string

tag

tag: BendTag

type

type: BendType

cuts

cuts: PolyCurve[]

outerBoundary

outerBoundary: PolyCurve


VertexTag

VertexTag = { radius: number; type: "bend"; } | { angle: number; type: "miter"; }

Last updated: 📖 3 min readEdit on GitHub