Transforms
Steps that take the stream and return it changed. The valid data kinds are listed per method.
45 methods: looseToBlock, textOnCurve, curveProject, curveOffset, curveThicken, curveSmooth, curveSimplify, curveUnion, curveSubtract, curveIntersect, curveSplit, curveFillet, curveChamfer, curveOvercut, solidSelfUnion, curveSelfUnion, move, rotate, resize, scale, reverse, faceMaterial, applyLayer, applyAttribute, applyVisible, applyLineStyle, keepData, arrayLinear, arrayLattice, arrayRadial, arrayDistances, arrayCurve, arraySegments, arrayCorners, scatter, mirror, solidUnion, solidSubtract, solidIntersect, curveExtrude, curveSweep, faceExtrude, curveRevolve, curveLoft, faceContours.
looseToBlock - Loose to Blocks
Collect loose curves/meshes into blocks by connectivity — each connected cluster becomes one nested block.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key block.
textOnCurve - Text On Path
Glyphs laid along the chain's own path curve; the chain is consumed.
role transform, type step, valid on curve, returns objectData[], default key text.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
text | string | 'Hello' | The text to lay out; one glyph outline per character. | |||
font | font | Font url-method parameter key; an unresolved font records a pending load request and this step fails soft until it arrives. | ||||
fontSize | length | 10 | Font size, mm — scales the font's em square; actual glyph height is a font-dependent fraction of this, not exactly this value. |
curveProject - Project Onto Mesh
Cast each vertex along the direction, snap to the nearest mesh hit.
role transform, type step, valid on curve, returns objectData[], default key project.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
target | meshData[] | Mesh the curve's vertices are cast onto. | ||||
direction | vector | [0,0,-1] | Object-local cast direction, must be non-zero; each vertex moves to the target's first hit along it, or the step fails naming that vertex. |
curveOffset - Offset Curve
Offsets every closed loop by distance.
role transform, type step, valid on curve, returns objectData[], default key offset.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
distance | length | 10 | Positive = outward, negative = inward. | |||
joinType | string | 'round' | ['round', 'miter', 'square'] | Corner style where the offset loop's segments meet. |
curveThicken - Thicken Curve
Strokes an open or closed chain into a closed strip.
role transform, type step, valid on curve, returns objectData[], default key thicken.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
distance | length | 10 | Offset on each side; the strip is twice this wide. | |||
joinType | string | 'miter' | ['round', 'miter', 'square'] | Corner style at interior corners of the stroked strip. | ||
endType | string | 'round' | ['round', 'square', 'butt'] | Cap style at an open chain's two ends; ignored when the chain is closed. | ||
normal | vector | Normal of the stroke plane: names the plane of a chain that fixes none (a single straight segment) and fixes the side of any chain (an open chain's result faces this normal, so a following extrude goes toward it); absent = inferred from the chains, a straight chain then fails and the side follows the chain's own winding. A chain that fixes its own plane must lie in a plane with this normal. The offset plane is given explicitly, as in Rhino Curve.Offset(plane, distance, tolerance, cornerStyle). |
curveSmooth - Smooth Curve
Chaikin corner-cutting.
role transform, type step, valid on curve, returns objectData[], default key smooth.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
iterations | integer | 2 | 1 | Chaikin corner-cutting passes; each doubles the vertex count, which must stay within the engine's array budget (1,000,000). |
curveSimplify - Simplify Curve
Douglas-Peucker vertex reduction.
role transform, type step, valid on curve, returns objectData[], default key simplify.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
tolerance | length | 1 | Douglas-Peucker distance tolerance, mm; larger removes more points. |
curveUnion - Curve Union
2D boolean union.
role transform, type step, valid on curve, returns objectData[], default key union.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
curve | curveData | point[] | Operand curve unioned with the chain's own stream, per coplanar plane group. Point rows [x,y,z] bake to a polyline; repeat the first row to close it, and a list of such row lists gives several chains. |
curveSubtract - Curve Subtract
2D boolean difference.
role transform, type step, valid on curve, returns objectData[], default key subtract.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
curve | curveData | point[] | Operand curve subtracted from the chain's own stream, per coplanar plane group. Point rows [x,y,z] bake to a polyline; repeat the first row to close it, and a list of such row lists gives several chains. |
curveIntersect - Curve Intersect
2D boolean intersection.
role transform, type step, valid on curve, returns objectData[], default key intersect.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
curve | curveData | point[] | Operand curve intersected with the chain's own stream, per coplanar plane group. Point rows [x,y,z] bake to a polyline; repeat the first row to close it, and a list of such row lists gives several chains. |
curveSplit - Curve Split
Splits a single open chain into two at the given parameter; fails if the stream holds more than one chain or the chain is closed.
role transform, type step, valid on curve, returns objectData[], default key split.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
parameter | number | 0.5 | Normalized arc-length position. |
curveFillet - Curve Fillet
Rounds every interior corner the filter selects (default: every corner).
role transform, type step, valid on curve, returns objectData[], default key fillet.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
radius | length | 5 | Fillet radius, mm; fails if a corner's adjacent edges are shorter than the trim it needs. | |||
filter | function | (p, i) => true | Callback (point, index) => boolean per corner, index counted within its own chain; default rounds every corner. |
curveChamfer - Curve Chamfer
Cuts every interior corner the filter selects (default: every corner).
role transform, type step, valid on curve, returns objectData[], default key chamfer.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
distance | length | 5 | Chamfer setback along each adjacent edge, mm; fails if an edge is shorter than this. | |||
filter | function | (p, i) => true | Callback (point, index) => boolean per corner, index counted within its own chain; default chamfers every corner. |
curveOvercut - Curve Overcut
CNC corner-clearance relief (dogbone/T-bone) at every corner the filter selects.
role transform, type step, valid on curve, returns objectData[], default key overcut.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
radius | length | 5 | Relief radius, mm, used to size the dogbone/T-bone cut geometry. | |||
type | string | 'dogbone' | ['dogbone', 'longTbone', 'shortTbone'] | Relief style: dogbone bulges into both adjacent edges; longTbone/shortTbone extend only the longer or shorter edge. | ||
reduction | length | 0 | Amount the relief pulls back from the full radius/extension, mm. | |||
filter | function | (p, i) => true | Callback (point, index) => boolean per corner, index counted within its own chain; default relieves every corner. |
solidSelfUnion - Solid Self Union
Fuse every mesh body in the stream into one (3D CSG, no operand).
role transform, type step, valid on mesh, returns objectData[], default key union.
curveSelfUnion - Curve Self Union
Fuse every curve into one region per coplanar group; an open curve in a group fails loud, and points collinear with their neighbours are removed.
role transform, type step, valid on curve, returns objectData[], default key union.
move - Move
Translate every document in the stream.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key move.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
vector | vector | [0,0,1] | [x, y, z] translation offset in mm, in object-local space. |
rotate - Rotate
Rotate every document about an axis.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key rotate.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
axis | line | { origin: [0,0,0], direction: [0,0,1] } | The line (origin + direction) to rotate about, in object-local space. | |||
angle | angle | function | 0 | Degrees; a function value fails at evaluate — there is no per-document argument to call it with. |
resize - Resize
Non-uniform scale to a target bounding-box size.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key resize.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
sizeX | length | function | 1 | Target bounding-box X size in mm; a function value fails at evaluate. | |||
sizeY | length | function | 1 | Target bounding-box Y size in mm; a function value fails at evaluate. | |||
sizeZ | length | function | 1 | Target bounding-box Z size in mm; a function value fails at evaluate. |
scale - Scale
Scale every document about a point by per-axis factors.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key scale.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
factors | vector | function | [1, 1, 1] | Per-axis [x, y, z] scale factors; a function value fails at evaluate. | |||
center | point | [0, 0, 0] | The point [x, y, z] in mm the scale is applied about, in object-local space. |
reverse - Reverse
Flip curve order / face winding.
role transform, type step, valid on curve, mesh, returns objectData[], default key reverse.
faceMaterial - Material
Stamp a materials[] key on the whole document or matching faces.
role transform, type step, valid on curve, mesh, block, returns objectData[], default key faceMaterial.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
material | material | function | '' | Key of a materials[] record; stamps the rows, or the matching ones under a filter. | |||
filter | function | (faceIndex) => boolean predicate selecting which mesh faces get the material; absent stamps every face. Curve/block content rejects a filter. |
applyLayer - Layer
Whole-object layer claim, lifted at the fold — data unchanged.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key layer.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
layer | layer | function | 'Layer1' | Key of a layers[] record. |
applyAttribute - Attribute
Stamp a free-form key/value on every row.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key attribute.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
key | string | 'type' | Attribute name; engine-reserved keys fail loud. | |||
value | object | function | '' | Any JSON-serializable value to store under key; a function value fails at evaluate. |
applyVisible - Visible
Whole-object visibility claim, lifted at the fold.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key visible.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
visible | boolean | function | true | Whole-document visibility claim; a function value fails at evaluate (visibility is lifted at the fold, not stamped per instance). |
applyLineStyle - Line Style
Stamp every curve edge's dash pattern.
role transform, type step, valid on curve, returns objectData[], default key lineStyle.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
lineStyle | string | function | 'solid' | One of 'solid' | 'dashed' | 'dotted'; a function value fails at evaluate. |
keepData - Keep Entities
Keep only the documents the predicate accepts.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key keep.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
keep | function | (center, type, index) => true | (center, type, index) => boolean predicate; center is [x,y,z] mm, type is 'curveData'|'meshData'|'blockData'|'objectData', index is the stream position — a document is kept when it returns true. |
arrayLinear - Linear Array
Copies stepped by a constant vector.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key array.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
vector | vector | [100,0,0] | Per-copy step. | |||
copies | integer | 2 | 0 | Copies added. |
arrayLattice - Lattice Array
Copies stepped by two lattice vectors over a region.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key array.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
vectorA | vector | [100,0,0] | First lattice vector. | |||
vectorB | vector | [0,100,0] | Second lattice vector. | |||
region | curveData | point[] | Closed planar region the copies must reach; copies whose box misses its box are not made. |
arrayRadial - Radial Array
Copies spaced evenly about an axis.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key array.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
axis | line | { origin: [0,0,0], direction: [0,0,1] } | The line (origin + direction) copies revolve about. | |||
copies | integer | 5 | 0 | Copies added, evenly over 360deg. |
arrayDistances - Array by Distances
Copies at explicit cumulative distances along a direction.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key array.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
direction | vector | [1,0,0] | Normalized; magnitude ignored. | |||
distances | length[] | [300,400,500] | Step from the previous copy (not an absolute position); copies sit at the running sum of these values along direction. |
arrayCurve - Array Along Curve
Copies distributed along a path curve's own frame.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key array.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
curve | curveData | point[] | Path the copies distribute along: a curve, a sibling object, or point rows [x,y,z] (repeat the first row to close the path). | ||||
copies | integer | 4 | 0 | Total placements along the curve is this plus one; none keeps the object's original position. | ||
angle | angle | 0 | Extra rotation about the tangent. |
arraySegments - Array Along Curve Segments
Copies distributed along a path curve, the distribution restarting at every original segment (corner-to-corner), SketchUp Copy Along's "Each Segment" mode.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key array.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
curve | curveData | point[] | Path the copies distribute along: a curve, a sibling object, or point rows [x,y,z] (repeat the first row to close the path). | ||||
distribution | string | 'count' | ['count', 'distance', 'gap'] | count: value copies ADDED, evenly spaced, per segment. distance: a copy every value mm from each segment's own start, the last one possibly short of its end. gap: the most copies whose spacing, evenly spread across the segment, is at least value mm. | ||
value | number | 1 | Copies added per segment (distribution 'count'), step in mm (distribution 'distance'), or the smallest spacing in mm (distribution 'gap'). | |||
marginStart | length | 0 | 0 | Trimmed from the start of every segment before distributing, mm. | ||
marginEnd | length | 0 | 0 | Trimmed from the end of every segment before distributing, mm. | ||
angle | angle | 0 | Extra rotation about the tangent. |
arrayCorners - Array On Curve Corners
One copy at each original vertex of a path curve (its corners), SketchUp Copy Along's "On Corners" mode.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key array.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
curve | curveData | point[] | Path the copies distribute along: a curve, a sibling object, or point rows [x,y,z] (repeat the first row to close the path). | ||||
angle | angle | 0 | Extra rotation about the tangent. |
scatter - Scatter
Random area-weighted placement across a mesh's surface.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key scatter.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
mesh | meshData[] | The mesh surface copies are scattered across, area-weighted. | ||||
copies | integer | 20 | 0 | Total placements scattered across the surface is this plus one; none keeps the object's original position. | ||
seed | number | 0 | Random seed; the same seed reproduces the same scatter. |
mirror - Mirror
Reflects across a plane; a mesh reverses winding to stay outward-positive.
role transform, type step, valid on curve, mesh, pointCloud, block, returns objectData[], default key mirror.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
plane | plane | { point: [0,0,0], normal: [1,0,0] } | The mirror plane (point + normal) copies are reflected across. | |||
keepOriginal | boolean | true | true keeps the original and adds the reflection; false replaces it with only the reflection. |
solidUnion - Solid Union
3D CSG union.
role transform, type step, valid on mesh, returns objectData[], default key union.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
solid | meshData[] | The mesh(es) to union with each mesh in the stream; several operands are self-unioned into one first. |
solidSubtract - Solid Subtract
3D CSG difference.
role transform, type step, valid on mesh, returns objectData[], default key subtract.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
solid | meshData[] | The mesh(es) to subtract from each mesh in the stream; several operands are self-unioned into one first. |
solidIntersect - Solid Intersect
3D CSG intersection.
role transform, type step, valid on mesh, returns objectData[], default key intersect.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
solid | meshData[] | The mesh(es) to intersect with each mesh in the stream; several operands are self-unioned into one first. |
curveExtrude - Extrude
Push closed curves into solids along their normal; an open chain is an error (close it, or thicken an open polyline with curveThicken first); a mesh in the stream instead extrudes every one of its faces by the same thickness along each face's own normal.
role transform, type step, valid on curve, mesh, returns meshData[], default key extrude.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
thickness | length | 10 | Distance along the profile's own normal (right-hand rule over its vertex order), in mm; a negative value extrudes the other way. |
curveSweep - Sweep
Sweep the chain's profile (any planar curve: x = offset from the path — inward for a closed path — y = height) along a curve; drawing it flat in XY at the origin is the simplest way, since that plane's origin is the point that sits on the path. Reuse one profile without redrawing it with mirrorX/mirrorY and anchor (mirror first, then anchor).
role transform, type step, valid on curve, returns meshData[], default key sweep.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
curve | curveData | point[] | [] | Path the profile is swept along: a curve, a sibling object, or point rows [x,y,z] (repeat the first row to close the path). A path of several chains is several paths: the profile is swept along each one on its own. | |||
twist | angle | 0 | Total profile rotation about the path tangent, start to end. | |||
scale | number | 1 | Profile scale factor at the path's end (1 at the start). | |||
mirrorX | boolean | false | Flip the profile across its own y axis, before anchor. | |||
mirrorY | boolean | false | Flip the profile across its own x axis, before anchor. | |||
anchor | string | 'origin' | ['origin', 'center', 'top', 'bottom', 'left', 'right', 'top-left', 'top-right', 'bottom-left', 'bottom-right'] | After mirroring, move this point of the profile's own bounding box onto the path. | ||
up | vector | Direction the profile's y axis points at the path start (projected perpendicular to the first tangent, so it must not be parallel to it); the frame then follows the path rotation-minimally. Absent: the path-class default. |
faceExtrude - Face Extrude
Push selected faces along their own normal.
role transform, type step, valid on mesh, returns objectData[], default key extrude.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
thickness | length | 10 | Distance each selected face moves along its own normal, in mm; negative moves it the other way. | |||
filter | function | (points, normal) => true | Callback (points, normal) => boolean over each face's object-local outer-loop corners and unit normal; default extrudes every face. |
curveRevolve - Revolve
Spin the chain's curves about an axis; a closed profile is capped into a solid on a partial sweep; the result must be closed: close the profile, or revolve a full turn with both chain ends on the axis.
role transform, type step, valid on curve, returns meshData[], default key revolve.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
axis | line | { origin: [0,0,0], direction: [0,0,1] } | Revolve axis as { origin, direction } in object space; the chain's curves sweep around this line. | |||
angle | angle | 360 | Sweep angle in degrees, positive by the right-hand rule around axis.direction; 360 makes a full closed solid of revolution. | |||
segments | integer | 48 | 3 | Tessellation density (no NURBS carrier to defer to). |
curveLoft - Loft
Skin a capped solid through the chain's closed curves in order, linearly between equal-count sections; an open section is an error (Mesh::loft has no smoothness parameter).
role transform, type step, valid on curve, returns meshData[], default key loft.
faceContours - Face Contours
Slices faces at evenly spaced Z levels into contour curves, replacing the faces; a spacing of 0 or less fails loud instead of silently passing the mesh through unsliced.
role transform, type step, valid on mesh, returns curveData[], default key contours.
| Arg | Type | Default | Min | Max | Options | Description |
|---|---|---|---|---|---|---|
spacing | length | 500 | 0 | Vertical spacing between contour levels, mm; levels run from base through the mesh's own Z range. Must be > 0 — the domain's own inclusive min of 0 is itself illegal and fails loud, since it names no spacing to slice at. | ||
base | number | 0 | Z reference for the contour levels, mm — levels are base + n*spacing, not necessarily one drawn exactly at base. |