Skip to content

Geometry Update

Curve/profile/contour update namespace — derive new geometry by editing existing handles. Inputs are never mutated; every method returns a fresh handle, and the original handle keeps referring to the unchanged geometry. Read the resulting geometry back as plain values with the query namespace. Accessed via snaptrude.core.geom.update.

Sub-namespaces

NamespaceAccessed viaOperations
Update: Curvesnaptrude.core.geom.update.curveExtend, split, trim, offset, reverse a CurveHandle
Update: Profilesnaptrude.core.geom.update.profileOffset, move/rotate/scale/mirror (affine), add/remove/reverse/simplify a ProfileHandle
Update: Contoursnaptrude.core.geom.update.contourOffset, move/rotate/scale/mirror (affine), addHole/removeHole on a ContourHandle

Immutable derive-new semantics

Every method in this namespace is an immutable derive-new operation: it takes an opaque handle (plus any extra inputs) and returns a new handle for the resulting geometry — the input is never mutated.

ts
// Offset a closed profile inward; `profile` still refers to the original
const inset = await snaptrude.core.geom.update.profile.offset(profile, -0.5);