@huukhanhnguyen/model / nodeMethods/render
nodeMethods/render
curvePolylinePoints()
curvePolylinePoints(
geometry,tolerance?): [number,number,number][]
Sample points of a (already tessellated) CurveData as Point[]. Degree-1 polylines return their control polygon exactly at any tolerance.
Parameters
geometry
tolerance?
number = DEFAULT_CURVE_TOLERANCE
Returns
[number, number, number][]
render()
render(
e,curveTolerance?):ObjectData
Tessellate one stream document into ordinary ObjectData vocabulary. The result is an ordinary *Data document — the fields sit on it directly, never under a geometry wrapper.
Parameters
e
curveTolerance?
number = DEFAULT_CURVE_TOLERANCE
Returns
renderLeaf()
renderLeaf(
e,curveTolerance?,patterns?,sheetScale?):ObjectData[]
One leaf document → the documents that DRAW it.
Almost always exactly one, and render() stays the single-document door. A hatch is the one leaf whose marks are not one document: a drawn length is a chain and a zero-length draw is a dot, and those are a CurveData and a PointCloudData respectively. Expanding it HERE rather than inside render() keeps that contract, and expanding it here rather than in bakeBlock() keeps the hatch document itself intact on the pre-bake tier — where the render frame, crop and the object door all still read it as a hatch.
A hatch's fill is paint over the region, not a mark, so it is NOT turned into geometry: the filled regions ride out as a hatch document for a renderer to paint behind the marks. It comes FIRST, which is the order it is painted in. The document keeps its pattern NAME (the lines live on the record now, so there is nothing left here to spend) — its linework is already expanded into the documents beside it, and a reader of this document paints fill only.
Empty documents are dropped rather than emitted: a { edges: [] } passes the curve sniff and then breaks every reader that reaches for edges[0] (nodeMethods/block.ts's weld keys, core/inspect.ts's metrics).
Parameters
e
curveTolerance?
number = DEFAULT_CURVE_TOLERANCE
patterns?
Pattern[]
sheetScale?
number
Model millimetres per sheet millimetre, for a pattern that measures its lengths in PAPER units (Pattern.lengthSpace === "paper").
Optional because the two in-repo callers render MODEL space, where there is no sheet and therefore no scale: rootFold folds the scene and bakeBlock expands a nest. A paper pattern reaching either of them throws by design — the number is one only a PLACEMENT knows, and inventing it would print a 2mm hatch at 0.02mm on a 1 view, which reads as solid black rather than as an error. A host that places a view on a sheet passes it here.
Returns
DEFAULT_CURVE_TOLERANCE
Re-exports DEFAULT_CURVE_TOLERANCE
facesToIndices
Re-exports facesToIndices