Skip to content
Shapemetry

@huukhanhnguyen/model / nodeMethods/toCurve

nodeMethods/toCurve

curveControlPoints()

curveControlPoints(geometry): Point[]

A curve value's NURBS CONTROL POINTS as [x, y, z] triples — the wire shape the kernel writes them in, and what scene's NurbsCurve spells.

Parameters

geometry

unknown

Returns

Point[]


curveGeometryToNurbs()

curveGeometryToNurbs(geometry): NurbsCurve

Curve document geometry (a PolyCurve) → the NurbsCurve every other kernel curve call reads. Single nurbs/analytic segments keep exact form via wasm; multi-segment chains sample to a polyline NURBS.

Parameters

geometry

unknown

Returns

NurbsCurve


curveJsonToPolyCurve()

curveJsonToPolyCurve(segment): PolyCurve

Bare Segment (line/arc/ellipse/nurbs) → one-segment PolyCurve.

Parameters

segment

Segment

Returns

PolyCurve


curveNurbsText()

curveNurbsText(geometry): string

The same recovery as a JSON STRING — what every NurbsCurve.* reader takes as its first argument, without the parse/stringify round trip in between.

Parameters

geometry

unknown

Returns

string


curvePoints()

curvePoints(geometry, tolerance): Point[]

A curve value's world polyline — PolyCurve.tessellate unpacked from its flat [x, y, z, ...] run. Line segments emit their endpoints exactly; curved segments subdivide to the CALLER's chord tolerance. The old route through curveNurbsText capped that tolerance at the door's own chain sample (CHAIN_SAMPLE_TOLERANCE = 0.5, crates/geometry/src/curve/to_curve.rs), so a caller asking for 0.01 got 0.5 and never heard about it.

Parameters

geometry

unknown

tolerance

number

Returns

Point[]


isNurbsCurve()

isNurbsCurve(value): value is NurbsCurve

Parameters

value

unknown

Returns

value is NurbsCurve


nurbsToPolyCurve()

nurbsToPolyCurve(nurbs): PolyCurve

Bare NurbsCurve → one-segment PolyCurve (document geometry).

Parameters

nurbs

NurbsCurve

Returns

PolyCurve


parsePolyCurve()

parsePolyCurve(value): PolyCurve

Parse / assert a PolyCurve document.

Parameters

value

unknown

Returns

PolyCurve


polyCurveFromPoints()

polyCurveFromPoints(points, closed?): PolyCurve

Build a PolyCurve chain of line segments through ordered points.

Parameters

points

Point[]

closed?

boolean = false

Returns

PolyCurve


polyCurveText()

polyCurveText(geometry): string

A curve value as the PolyCurve JSON STRING every PolyCurve.* reader takes — the chain's OWN text, with no NURBS recovery in between. This is the door for the whole poly_curve_* roster: each kind is measured natively (a line by distance, an arc by radius x |sweep|), so nothing is chorded before it is asked a question.

Parameters

geometry

unknown

Returns

string


toCurve()

toCurve(value, options?): PolyCurve

Coerce to a PolyCurve document. Accepts:

  • curve document
  • PolyCurve
  • bare NurbsCurve (one-segment wrap)
  • bare Segment (type-tagged)
  • Point[]

Parameters

value

unknown

options?

closed?

boolean

Returns

PolyCurve


toNurbsCurve()

toNurbsCurve(value): NurbsCurve

Coerce to NurbsCurve (consumers that need control points).

Parameters

value

unknown

Returns

NurbsCurve


unflattenPoints()

unflattenPoints(samples): Point[]

Flat [x, y, z, ...] kernel run -> [x, y, z] triples.

Parameters

samples

ArrayLike<number>

Returns

Point[]


isPolyCurve

Re-exports isPolyCurve

Last updated: 📖 3 min readEdit on GitHub