Skip to content
Shapemetry

@huukhanhnguyen/geometry / catalog/curve

catalog/curve

Curve

Curve = Curve

3D curve document — collection of ordered space chains.

Wire: { curves: PolyCurve[], transformation? }. Construct and transform only; boolean/offset stay on Curve2d.


Curve2d

Curve2d = Curve2d

2D filled/stroked curve document ops (wasm path2d_*).


Curve

Curve: { empty: string; fromCurves: string; fromPolyCurve: string; transform: string; }

3D curve document — collection of ordered space chains.

Wire: { curves: PolyCurve[], transformation? }. Construct and transform only; boolean/offset stay on Curve2d.

empty()

readonly empty(): string

Empty curve document (no curves).

Returns

string

fromCurves()

readonly fromCurves(curvesJson): string

Build a Curve from a JSON array of PolyCurve objects, or pass through an existing Curve document object.

Parameters

curvesJson

string

Returns

string

fromPolyCurve()

readonly fromPolyCurve(compositeJson): string

Wrap one PolyCurve JSON string as a single-chain Curve.

Parameters

compositeJson

string

Returns

string

transform()

readonly transform(curveJson, elements): string

Apply a 4×4 matrix to every polycurve in the document. Document-level transformation (if present) is left unchanged — call sites that want placement composition do that outside.

Parameters

curveJson

string

elements

number[] | Float64Array<ArrayBufferLike>

Returns

string


Curve2d

Curve2d: namespaces/Curve2d

2D filled/stroked curve document ops (wasm path2d_*).

Last updated: 📖 1 min readEdit on GitHub