curve nodes

30 node types in the curve category.

bezier#

aliases: bezier_curve beziercurve

Bezier curve prim from control points (CVs) and an order; evaluates exactly wherever it is used.

Houdini Curve SOP in Bezier mode (a BezierCurve prim). Segments of order CVs share their end CVs: 7 CVs of order 4 make two cubic segments (CVs 0-3 and 3-6); a closed curve wraps back to CV 0 (segments × (order-1) CVs). The CVs are ordinary points: transform, deformers, wrangles and attribute nodes move or edit them, and point attributes (Cd, width, Pw weights) blend along the curve. Nodes that need polylines get the evaluated curve automatically (with a note); convert_curve/resample choose the resolution. With an input, each polyline/polygon (or, without prims, all points in order) becomes a Bezier prim on those points.

Inputs

#namedescription
0pointsoptional: polylines/polygons (or ordered points) whose points become CVs (optional)

Parameters

nametypedefaultrangedescription
pointsjson[[0,0,0],[0.6,1.2,0],[1.6,1.2,0],[2.2,0,0],[2.8,-1.2,0],[3.8,-1.2,0],[4.4,0,0]]CVs [[x,y,z], …] when no input is connected (2-number entries → [x, 0, z])
aliases: cvs positions pts
orderint42..11order = degree + 1 (4 = cubic, 3 = quadratic, 2 = linear)
closedboolfalseclosed curve (wraps back to the first CV; regular with a multiple of order-1 CVs)
weightsjson[]rational weight per CV (point attribute Pw; [] = all 1); larger pulls the curve toward the CV

Writes: Bezier prims (prim spline_order; point Pw with weights)

Example

{
  "type": "bezier",
  "params": {
    "points": [[0, 0, 0], [1, 2, 0], [3, 2, 0], [4, 0, 0]],
    "order": 4
  }
}

boolean2d#

aliases: curve_boolean shape_boolean

2D boolean of closed shapes in a plane (union / subtract / intersect / xor).

Within each input, a shape lying wholly inside another is a hole in it (a merged plate and circle make a plate with a hole), a shape inside that hole an island, and shapes that only overlap are joined. Faces with holes come out as a few polygons that share edges.

Inputs

#namedescription
0ashapes A
1bshapes B (optional: union of A with itself) (optional)

Parameters

nametypedefaultrangedescription
operationenum"union"boolean op
options: union subtract intersect xor
aliases: op mode
outputenum"faces"faces = filled, holes cut (a face with holes as a few polygons sharing edges); outlines = closed contour polygons
options: outlines faces
planeenum"auto"shape plane
options: auto xz xy yz

Example

{
  "nodes": {
    "plate": {
      "type": "shape2d",
      "params": {
        "shape": "rounded_rect",
        "size": [3, 1.5],
        "corner_radius": 0.2
      }
    },
    "hole": { "type": "circle", "params": { "radius": 0.4, "segments": 32 } },
    "cut": {
      "type": "boolean2d",
      "in": ["plate", "hole"],
      "params": { "operation": "subtract" }
    }
  },
  "output": "cut"
}

Used in the examples market_street, town_from_lots.

carve#

Trim curves to a portion of their length (u range 0..1).

Inputs

#namedescription
0curvespolylines (Bezier/NURBS curves are evaluated first)

Parameters

nametypedefaultrangedescription
startfloat00..1start u (0..1 of arc length)
endfloat0.50..1end u

Example

{
  "nodes": {
    "path": { "type": "spiral", "params": { "turns": 2 } },
    "part": {
      "type": "carve",
      "in": ["path"],
      "params": { "start": 0.25, "end": 0.75 }
    }
  },
  "output": "part"
}

circle#

aliases: arc ellipse

Circle / ellipse / arc. Full circles are closed polygons (faces); arcs or open=true give polylines.

Inputs

None (generator).

Parameters

nametypedefaultrangedescription
radiusfloat1radius
aliases: rad r
scalevec2[1,1]ellipse scale along the plane axes
segmentsint323..1000000number of segments
aliases: divisions divs points
planeenum"xz"orientation plane (xz = ground, facing +Y; xy = facing +Z; yz = facing +X)
options: xz xy yz
centervec3[0,0,0]center position
aliases: t translate position pos origin
arcvec2[0,360]begin/end angle in degrees (anything < 360 makes an open arc)
openboolfalseoutput an open polyline instead of a closed polygon face

Example

{ "type": "circle", "params": { "radius": 2, "segments": 48, "arc": [0, 180] } }

Used in the example market_street.

convert_curve#

aliases: convert curve_convert

Convert curves between polyline, Bezier and NURBS (exact between spline types; fit to pass through points).

Houdini Convert SOP for curves. Spline → polyline evaluates the curve (adaptive by tolerance, or segments per span); closed splines become closed polygons. Bezier ↔ NURBS is exact (multiple knots / blossoming; a short last Bezier segment is degree-elevated). Polyline → spline uses the points as CVs, or with fit passes through them (NURBS: global interpolation; Bezier: smooth cubic segments). Attributes follow (CV blends). Use convert to polyline before nodes that need a specific resolution; others convert automatically.

Inputs

#namedescription
0curvespolylines, polygons, Bezier or NURBS curves

Parameters

nametypedefaultrangedescription
toenum"polyline"target type
options: polyline bezier nurbs
aliases: type target
orderint42..11order of curves made from polylines (fit Bezier is always cubic)
fitboolfalsepolylines → spline: pass through the points instead of using them as CVs
aliases: interpolate
parameterizationenum"centripetal"knots of NURBS made from polylines (parameterisation: uniform (even), chord (follows point distances), centripetal (√distances; best for sharp turns))
options: uniform chord centripetal
segmentsint00..10000to polyline: segments per knot span / Bezier segment; 0 = adaptive (tolerance)
aliases: divisions lod
tolerancefloat00..to polyline: largest chord-to-curve distance; 0 = 1/2000 of each curve's CV box diagonal
groupgroup (prim)""prim group pattern to affect ("" = all). e.g. "top", "!top", "0-9", "@P.y>0"

Example

{ "type": "convert_curve", "params": { "to": "polyline", "tolerance": 0.001 } }

curve#

aliases: polyline path spline

Curve through explicit points; optional Catmull-Rom smoothing or rounded corners; open or closed.

corner_radius rounds the corners with arcs tangent to both edges: one number for every corner, or a list with one radius per point (0 keeps that corner sharp; the ends of an open curve are never rounded). Radii that do not fit between neighbouring corners shrink. A point that is not three numbers (NaN, null, a missing coordinate) is an error that names it.

Inputs

None (generator).

Parameters

nametypedefaultrangedescription
pointsjson[[0,0,0],[1,0.5,0],[2,0,0]]list of [x,y,z] (2-number entries → [x, 0, z] on the ground)
aliases: positions pts
closedboolfalseclose the curve (makes a polygon)
smoothboolfalseCatmull-Rom interpolate through the points (not with corner_radius)
subdivisionsint81..10000smooth: samples per segment
corner_radiusjson0round the corners: a radius for every corner, or a list with one per point (0 = sharp)
aliases: fillet radius radii corner_radii
corner_segmentsint61..10000segments per rounded corner

Writes: point group fillet (the points of rounded corners)

Example

{
  "type": "curve",
  "params": {
    "points": [[0, 0, 0], [2, 0, 1], [4, 0, -1], [6, 0, 0]],
    "smooth": true,
    "subdivisions": 12
  }
}

Used in the examples asset_cleanup, machined_bracket, rusty_drum.

curve_attribs#

aliases: curveu curve_attributes orient_along_curve orientalongcurve

Write curveu, arclength, tangent, frames (N/up), curvature, segment index and ramps along curves.

Houdini Orient Along Curve plus the measure/attribute parts of Resample. Per point of each curve: curveu (0..1 by arc length), arclength (distance from the start), tangentu (unit tangent), with frame: N = tangent and up = rotation-minimising up (what copy_to_points needs to align copies along the curve; sweep reads up), curvature (1/radius; polylines: circle through the point and its neighbours), segment (index of the edge that starts at the point; splines: knot span / Bezier segment). ramp_attrib evaluates ramp at curveu into a float attribute (e.g. width for polywire, pscale for copies). On Bezier/NURBS prims the values are written on the CVs, evaluated on the curve at each CV's natural parameter (Greville abscissa).

Inputs

#namedescription
0curvespolylines, polygons, Bezier or NURBS curves

Parameters

nametypedefaultrangedescription
curveubooltruewrite point curveu (0..1 by arc length)
arclengthbooltruewrite point arclength (distance from the curve start)
aliases: length
tangentbooltruewrite point tangentu (unit tangent)
frameboolfalsewrite point N (= tangent) and up (rotation-minimising), for copy_to_points/sweep
aliases: orient frames
curvatureboolfalsewrite point curvature (1/radius)
segmentboolfalsewrite point int segment (edge / span index)
upvec3[0,1,0]initial up of the rotation-minimising frames (an input point attribute up steers them per point instead)
ramp_attribstring""float point attribute to fill with ramp(curveu), e.g. "width" ("" = none)
aliases: attrib name
rampramp[[0,1],[1,1]]value along the curve (u 0..1) for ramp_attrib
ramp_scalefloat1multiplier of the ramp values
groupgroup (prim)""prim group pattern to affect ("" = all). e.g. "top", "!top", "0-9", "@P.y>0"

Writes: point curveu, arclength, tangentu, N + up (frame), curvature, segment, ramp_attrib

Example

{
  "type": "curve_attribs",
  "params": {
    "frame": true,
    "ramp_attrib": "width",
    "ramp": [[0, 0.3], [1, 0.05]]
  }
}

Used in the example lsystem_tree.

ends#

aliases: unroll

Convert between closed polygons and open polylines (unroll outlines / close curves).

Inputs

#namedescription
0geopolygons or polylines (Bezier/NURBS curves are evaluated first)

Parameters

nametypedefaultrangedescription
modeenum"unroll"unroll: polygon → polyline outline (ends meet); close: polyline → polygon; open: polygon → polyline (drops closing edge)
options: unroll close open
groupgroup (prim)""prim group pattern to affect ("" = all). e.g. "top", "!top", "0-9", "@P.y>0"

Example

{
  "nodes": {
    "ring": { "type": "circle", "params": { "radius": 1, "segments": 32 } },
    "outline": {
      "type": "ends",
      "in": ["ring"],
      "params": { "mode": "unroll" }
    }
  },
  "output": "outline"
}

Used in the example town_from_lots.

extrude#

aliases: linear_extrude extrude2d

Extrude flat closed shapes into solids (holes supported). Quad sides + n-gon caps; groups top/bottom/side.

A shape that lies inside another shape of the same input is a hole, and a shape inside a hole is an island again; which way each outline winds does not matter. So a plate with round openings needs no boolean: merge a shape2d rect and circles placed inside it (all in one plane) and extrude the merge in one node, and the circles come out as holes through the solid. Shapes extruded in separate nodes and merged afterwards stay separate solids. Input attributes carry over as polyextrude carries them: caps and side walls take the attributes and groups of the shape they were made from (side walls of a hole take those of the hole), new points those of the point they came from, corners those of their source corner; N is dropped. A vertex uv stays on the caps, and side walls get their own: u once around the outline by length, v up the extrusion, both 0 to 1. scale_top [0, 0] (a pyramid) carries the same attributes and groups, except vertex uv. The apex point copies the first point of its source outline.

Inputs

#namedescription
0shapesclosed polygons lying in a plane (e.g. shape2d, circle, text)
1sheettrim sheet for trim_band (a trim_sheet node; optional: else the one the shapes carry) (optional)

Parameters

nametypedefaultrangedescription
heightfloat1extrusion distance along the plane normal: plane xz extrudes along +Y, xy along +Z, yz along +X
aliases: depth distance h
divisionsint11..10000segments along the extrusion
twistfloat0twist in degrees (about each shape centroid)
scale_topvec2[1,1]scale of the top cap (taper); [0,0] = pyramid
centerboolfalseextrude symmetrically about the shape plane
planeenum"auto"plane the shapes lie in, which sets the extrusion direction: xz extrudes along +Y, xy along +Z, yz along +X (auto = the flattest axis)
options: auto xz xy yz
capsbooltrueadd top/bottom caps
trim_bandstring""trim sheet band (or rectangle) to map onto ("" = the node's own uv): u runs along the path at the band's period, v fills the band across the height (its divisions are the segments: faces gives one course per division). A comma list ("stone, coping") gives one band per segment of the height (its divisions are the segments: faces gives one course per division), cycled. "sheet:band" picks a sheet when several are carried. Help topic trim_sheets.
aliases: trim
trim_aroundenum"wrap"wrap: consecutive segments of the height (its divisions are the segments: faces gives one course per division) on the same band share it by length (one band wrapped round); faces: every segment fills the whole band
options: wrap faces
trim_capstring""band for the caps at real size ("" = the sheet's first band of kind cap, else the first trim_band)
trim_offsetfloat0shift u along the path, metres (staggers the joints of pieces side by side)

Writes: prim groups top, bottom, side; the attributes and groups of the input (see above); with trim_band: vertex uv, prim trim_band, trim_sheet and detail trim_sheets

Example

{
  "nodes": {
    "star": {
      "type": "shape2d",
      "params": {
        "shape": "star",
        "radius": 1,
        "inner_radius": 0.5,
        "sides": 5
      }
    },
    "solid": {
      "type": "extrude",
      "in": ["star"],
      "params": { "height": 0.3, "scale_top": [0.8, 0.8] }
    }
  },
  "output": "solid"
}

Used in the examples cloth_drape, machined_bracket, market_street, scifi_panel.

fill#

aliases: fill_curves fill_outlines

Fill closed outlines into faces, cutting holes (even-odd), e.g. text outlines or nested shapes.

Inputs

#namedescription
0outlinesclosed polygons/polylines in a plane

Parameters

nametypedefaultrangedescription
ruleenum"EvenOdd"fill rule for overlapping contours
options: EvenOdd NonZero
planeenum"auto"plane
options: auto xz xy yz

Example

{
  "nodes": {
    "glyph": { "type": "text", "params": { "text": "B", "output": "outlines" } },
    "face": { "type": "fill", "in": ["glyph"] }
  },
  "output": "face"
}

Used in the example image_cutouts.

fillet_curve#

aliases: curve_fillet polyline_fillet polyfillet

Round, chamfer or Bezier-blend the corners of polylines and polygons (3D, any plane per corner).

Like Houdini's PolyPath/fillet tools for curves (Fillet SOP is for surfaces). Each corner whose turn exceeds angle_min (and whose point is in group) is replaced by an arc of radius tangent to both edges (round), a straight cut at the same tangent points (chamfer) or a quadratic Bezier through the corner's handle (bezier). clamp shrinks radii that do not fit between neighbouring corners. Corners of open curves at their ends are never filleted. Attributes are blended from the corner and its neighbours; new points join point group "fillet". Bezier/NURBS input is converted to polylines first (a smooth curve has no corners).

Inputs

#namedescription
0curvespolylines or polygons

Parameters

nametypedefaultrangedescription
radiusfloat0.20..fillet radius (chamfer/bezier: the same tangent points)
aliases: rad r
typeenum"round"corner shape
options: round chamfer bezier
aliases: shape mode
segmentsint61..10000segments per round/bezier corner
aliases: divisions
angle_minfloat10..180leave corners that turn less than this (degrees)
groupgroup (point)""corner points to fillet ("" = all), e.g. "@P.y>0", "0-4"
clampbooltrueshrink radii that do not fit between neighbouring corners
radius_attribstring""optional point float attribute multiplying the radius per corner

Writes: point group fillet (new corner points)

Example

{ "type": "fillet_curve", "params": { "radius": 0.5, "segments": 8 } }

Used in the example rail_along_curve.

line#

Straight polyline from an origin along a direction.

Inputs

None (generator).

Parameters

nametypedefaultrangedescription
originvec3[0,0,0]start point
aliases: start center
directionvec3[0,1,0]direction (normalised)
aliases: dir
lengthfloat1length
aliases: dist
pointsint22..1000000number of points
aliases: count npts

Example

{
  "type": "line",
  "params": { "direction": [1, 0, 0], "length": 5, "points": 11 }
}

Used in the examples corridor_panels, market_street, stair_flight.

lines_plan#

aliases: cage_from_lines lines_cage skin_lines

Build a cage from the long lines of a body so the smoothed surface passes through them.

Draw feature lines along the length of the body, with +Z toward the front by default. Give the lines in order around a cross-section. Use an object such as {"keel":[[0,0,-0.5],[0,0,0.5]],"belt":[[0.15,0.1,-0.5],[0.2,0.1,0.5]]} with other lines around the section, or connect named open curves. Four to seven well-placed points per line read smoother than many, and cv helps when the numbers are rough. Use round for noses, tips and domes, and point only for a sharp tip. Place an intake, lamp or outlet face with stations and rows_between, select it with groups, and inset and push it in with poly_extrude before subdivide to avoid jagged or cross-shaped openings. Count a quad mesh’s triangles with nvertices(0) - 2 * nprims(0) and keep the output in quads. Match fit_levels to the levels in subdivide so the surface passes through the sampled lines.

Inputs

#namedescription
0linesopen curves in section order with prim string name (defaults to line0, line1 and so on) (optional)

Parameters

nametypedefaultrangedescription
linesjson{"keel":[[0,-0.067,-0.5],[0,-0.128,-0.29],[0,-0.14,0],[0,-0.122,0.29],[0,-0.051,0.5]],"sill":[[0.059,-0.045,-0.5],[0.121,-0.091,-0.29],[0.137,-0.103,0],[0.117,-0.086,0.29],[0.053,-0.036,0.5]],"belt":[[0.085,0,-0.5],[0.183,0,-0.29],[0.203,0,0],[0.172,0,0.29],[0.075,0,0.5]],"shoulder":[[0.059,0.054,-0.5],[0.127,0.113,-0.29],[0.145,0.132,0],[0.125,0.105,0.29],[0.05,0.046,0.5]],"roof":[[0,0.075,-0.5],[0,0.149,-0.29],[0,0.177,0],[0,0.147,0.29],[0,0.062,0.5]]}feature line names and [x,y,z] points in metres in section order. A small pod is used when no curves are connected
axisenum"z"length axis for station positions in metres. Defaults to z, with the front toward +z. Use mirror none along x
options: x y z
interpolationenum"smooth"Smooth passes a shape-preserving cubic through the points. Linear joins the points with straight segments. CV uses the points as controls for a clamped uniform cubic B-spline that passes through both endpoints.
options: smooth linear cv
stationsjson12count or strictly ascending axis positions in metres. Defaults to 12 evenly spaced stations across the shared line range
mirrorenum"x"x mirrors the positive x half and shares centre lines by default. Use none for a full section
options: x none
closedbooltruejoin the section into a loop by default. For an open mirrored section, leave at least one end line off x = 0
rows_betweenjson0extra rows per line gap, as a count or a list of counts. Defaults to zero. Closed sections without mirroring include the last-to-first gap
endsjson"cap"open, cap, round, point, or a pair in ascending station order. Cap keeps a flat grid inside a sharp rim. Round fits a dome to the tip where the lines meet. Point makes a sharp tip
creasesjson{}line names with subdivision sharpness weights or [axis position in metres, weight] keys. Defaults to no creases. Keys interpolate linearly and are zero outside their range
groupsjson{}named face selections with between: [line, line] and optional from and to in metres, snapped to the nearest stations. Repeat a boundary line name to select the strip across its mirror. Unmirrored closed sections read between in section order
fit_levelsint20..4number of subdivision levels to fit, two by default. Zero puts cage points directly on the sampled sections

Writes: point row (int), line (string), station (int); prim row and station (int), prim groups sides, caps and groups; edge groups line_<name>; vertex uv and creaseweight (float); detail fit_error (float, metres)

Example

{
  "nodes": {
    "cage": {
      "type": "lines_plan",
      "params": {
        "lines": {
          "keel": [
            [0, 0.004, -0.5],
            [0, -0.058, -0.478],
            [0, -0.128, -0.29],
            [0, -0.14, 0],
            [0, -0.122, 0.29],
            [0, -0.044, 0.478],
            [0, 0.006, 0.5]
          ],
          "sill": [
            [0, 0.004, -0.5],
            [0.052, -0.039, -0.478],
            [0.121, -0.091, -0.29],
            [0.137, -0.103, 0],
            [0.117, -0.086, 0.29],
            [0.047, -0.031, 0.478],
            [0, 0.006, 0.5]
          ],
          "belt": [
            [0, 0.004, -0.5],
            [0.075, 0, -0.478],
            [0.183, 0, -0.29],
            [0.203, 0, 0],
            [0.172, 0, 0.29],
            [0.066, 0.001, 0.478],
            [0, 0.006, 0.5]
          ],
          "shoulder": [
            [0, 0.004, -0.5],
            [0.052, 0.048, -0.478],
            [0.127, 0.113, -0.29],
            [0.145, 0.132, 0],
            [0.125, 0.105, 0.29],
            [0.044, 0.041, 0.478],
            [0, 0.006, 0.5]
          ],
          "roof": [
            [0, 0.004, -0.5],
            [0, 0.066, -0.478],
            [0, 0.149, -0.29],
            [0, 0.177, 0],
            [0, 0.147, 0.29],
            [0, 0.055, 0.478],
            [0, 0.006, 0.5]
          ]
        },
        "ends": "round",
        "stations": [
          -0.5, -0.478, -0.429, -0.306, -0.184, -0.061, 0.061, 0.184, 0.306,
          0.429, 0.478, 0.5
        ],
        "creases": {
          "belt": [[-0.38, 0], [-0.14, 1.6], [0.14, 1.6], [0.38, 0]]
        },
        "groups": {
          "side_panel": {
            "between": ["belt", "shoulder"],
            "from": -0.16,
            "to": 0.17
          }
        }
      }
    },
    "body": { "type": "subdivide", "in": ["cage"], "params": { "levels": 2 } }
  },
  "output": "body"
}

loft#

aliases: skin

Skin a surface through a sequence of curves (in prim order), or through copies of one profile placed by "sections".

Sections: with several input curves, each is a section in prim order. With one curve and the sections list, each entry places a copy of it: {"offset": [x, y, z], "scale": [sx, sy], "rotate": [rx, ry, rz]} (any key may be left out; a number for offset moves it along the curve's normal, a number for scale scales it evenly), applied as scale and rotate about the curve's centre, then the offset. Correspondence: when every section has the same number of points, point k of one section joins point k of the next (insets and rounded corners stay where they are); otherwise each section is resampled evenly by length (resample "length"). Closed sections are turned to run the same way round as the first one, and each starts at the point nearest the previous section's start, so the skin does not twist. Winding: the side faces follow the first section's direction; a closed result (closed sections with caps, or closed: true) is turned to face outward, caps included. uv: u along the section, v across the sections.

Inputs

#namedescription
0curvestwo or more curves, in order; or one profile with sections

Parameters

nametypedefaultrangedescription
sectionsjson[]one input curve: a list of placements, each {offset, scale, rotate} (see the description)
aliases: stations placements
resampleenum"auto"auto = keep the points when every section has the same count, else even by length; length = always resample evenly; none = points by index (counts must match)
options: auto length none
closedboolfalseconnect the last curve back to the first
capsboolfalsecap the first and last curves (when they are closed)

Writes: vertex uv; prim groups caps, sides

Example

{
  "nodes": {
    "a": { "type": "circle", "params": { "radius": 1, "segments": 32 } },
    "b": {
      "type": "circle",
      "params": { "radius": 0.5, "segments": 32, "center": [0, 1, 0] }
    },
    "c": {
      "type": "circle",
      "params": { "radius": 0.8, "segments": 32, "center": [0, 2, 0] }
    },
    "rings": { "type": "merge", "in": ["a", "b", "c"] },
    "skin": { "type": "loft", "in": ["rings"], "params": { "caps": true } }
  },
  "output": "skin"
}

nurbs#

aliases: nurbs_curve nurbscurve

NURBS curve prim from control points (CVs), order, knots and weights; or through points with fit.

Houdini Curve SOP in NURBS mode (a NURBCurve prim). Open curves have n + order knots (automatic: clamped, so the curve starts and ends on its end CVs); closed curves are periodic with n + 1 breakpoints. fit:true makes the curve pass through the points (global interpolation; the CVs are computed). The CVs are ordinary points (transform/deform/wrangle move them, attributes blend along the curve); nodes that need polylines get the evaluated curve automatically. With an input, each polyline/polygon (or all points in order) becomes a NURBS prim.

Inputs

#namedescription
0pointsoptional: polylines/polygons (or ordered points) whose points become CVs (or are interpolated with fit) (optional)

Parameters

nametypedefaultrangedescription
pointsjson[[0,0,0],[1,0,1.5],[2.5,0.5,1.5],[3,1,0],[4.5,0.5,-0.5],[5.5,0,0.5]]CVs [[x,y,z], …] when no input is connected (2-number entries → [x, 0, z])
aliases: cvs positions pts
orderint42..11order = degree + 1 (4 = cubic); lowered when there are fewer CVs
closedboolfalseclosed (periodic) curve
knotsjson[]explicit knots: open n + order non-decreasing values, closed n + 1 breakpoints; [] = automatic
parameterizationenum"uniform"automatic knot spacing (parameterisation: uniform (even), chord (follows point distances), centripetal (√distances; best for sharp turns))
options: uniform chord centripetal
aliases: knot_spacing parameterisation
weightsjson[]rational weight per CV (point attribute Pw; [] = all 1)
fitboolfalseinterpolate: the curve passes through the points (CVs computed) instead of using them as CVs
aliases: interpolate through_points

Writes: NURBS prims (prim spline_order, prim float[] knots; point Pw with weights)

Example

{
  "type": "nurbs",
  "params": {
    "points": [[0, 0, 0], [2, 0, 2], [4, 0, 0], [6, 0, 2]],
    "fit": true
  }
}

offset_curve#

aliases: polyexpand2d offset2d inset2d strap stroke

2D offset (grow/shrink) of closed shapes, like PolyExpand2D. Negative distance = inset. Open paths become straps.

Closed shapes grow by distance (shrink when negative). An open path (a polyline whose ends do not meet) becomes a strap: a closed outline at |distance| on both sides, with its ends cut square at the end points (cap butt), rounded, or extended by the distance; extrude it for a 3D strap or band. Shapes and straps in one input are joined. Each output outline or strap keeps its source prim attributes and groups. When shapes merge, the lowest source prim number wins. Each output point copies the attributes of the nearest point on its source prim and keeps its new position.

Inputs

#namedescription
0shapesclosed polygons in a plane, or open paths for straps

Parameters

nametypedefaultrangedescription
distancefloat0.1offset distance (negative shrinks); straps: half their width
aliases: offset dist
joinenum"round"corner style
options: round miter square
capenum"butt"strap ends: butt = cut square at the end point, round = half circle, square = extended by the distance
options: butt round square
segmentsint163..10000segments per full circle for round joins and caps
outputenum"outlines"outlines = closed polygons per contour; faces = filled with holes cut
options: outlines faces
planeenum"auto"shape plane
options: auto xz xy yz

Example

{
  "nodes": {
    "plan": {
      "type": "shape2d",
      "params": { "shape": "L", "size": [4, 3], "thickness": 1.2 }
    },
    "inner": {
      "type": "offset_curve",
      "in": ["plan"],
      "params": { "distance": -0.2, "join": "miter" }
    }
  },
  "output": "inner"
}

Used in the example market_street.

offset_curve_3d#

aliases: curve_offset offset3d polyoffset

Offset curves sideways in 3D (rotation-minimising frame or a fixed plane normal): rails, kerbs, parallel paths.

Each edge moves by distance along its side vector direction × up (positive = to the right of the direction of travel, like side_offset of points_along_curve), where up comes from a rotation-minimising frame started at up (point attribute up overrides) or, with frame "plane", is the fixed up normal (keeps both rails level on a sloped path). Corners: mitre (sharp; beyond mitre_limit × distance becomes bevel), round or bevel on the outer side; inner corners always meet at the mitre point. lift raises the result along up. both:true writes the -distance offset too (prim int side ±1) — a double rail for sweep. Bezier/NURBS curves are sampled first. offset_curve is the 2D (Clipper) offset of closed shapes in a plane: use it for outlines/insets of flat shapes, this one for open 3D paths.

Inputs

#namedescription
0curvespolylines/polygons (Bezier/NURBS curves are sampled adaptively)

Parameters

nametypedefaultrangedescription
distancefloat0.25side offset, positive = right of the direction of travel (negative = left)
aliases: offset dist
liftfloat0offset along up (e.g. rail height)
aliases: height up_offset
frameenum"rmf"rmf = rotation-minimising frame along each curve; plane = fixed up normal
options: rmf plane
upvec3[0,1,0]initial up (rmf) or the plane normal (plane)
aliases: normal plane_normal
cornerenum"mitre"outer corner style
options: mitre round bevel
aliases: join corners
mitre_limitfloat41..mitres longer than this × distance are bevelled
aliases: miter_limit
round_segmentsint41..10000segments per 90° of round corners
bothboolfalsealso output the -distance offset (two rails; prim int side = +1 / -1)
aliases: both_sides double
keep_inputboolfalsekeep the input curves as well
groupgroup (prim)""prim group pattern to affect ("" = all). e.g. "top", "!top", "0-9", "@P.y>0"

Writes: prim int side (+1 / -1) with both

Example

{
  "type": "offset_curve_3d",
  "params": { "distance": 0.6, "lift": 1, "both": true }
}

Used in the example rail_along_curve.

parametric_curve#

Curve from a JS expression of t returning [x,y,z] (e.g. helices, knots, Lissajous).

The expression runs sandboxed like a wrangle and reads graph vars by their bare name ([cos(tTAU) * radius, t, sin(tTAU) * radius]); all points together must be computed within the script timeout (TOPOTOPO_SCRIPT_TIMEOUT_MS, default 30 s).

Inputs

None (generator).

Parameters

nametypedefaultrangedescription
exprcode"[cos(t*TAU), t, sin(t*TAU)]"JS expression (or body with return) of t (and i) returning [x,y,z]. Snippet helpers available.
rangevec2[0,1]t start and end
countint1002..1000000number of points
aliases: points segments
closedboolfalseclosed curve (polygon)

Example

{
  "type": "parametric_curve",
  "params": {
    "expr": "[(2+cos(3*t))*cos(2*t), sin(3*t), (2+cos(3*t))*sin(2*t)]",
    "range": [0, 6.2832],
    "count": 400,
    "closed": true
  }
}

Used in the examples eroded_valley, unreal_landscape.

polywire#

aliases: wire tubes

Turn curves into tubes. Per-point radius from "width" (diameter) or radius × pscale. Great for branches, cables, wireframes.

The tube radius at each point is half its "width" attribute when the curves carry width and use_width is on; pscale is then ignored, so particle trails with a small pscale keep the width they were given. Without width (or with use_width off) the radius is the radius param times point pscale (1 when there is none).

Inputs

#namedescription
0curvespolylines (or polygon edges); Bezier/NURBS curves are sampled adaptively
1sheettrim sheet for trim_band (a trim_sheet node; optional: else the one the curves carry) (optional)

Parameters

nametypedefaultrangedescription
radiusfloat0.05tube radius when there is no width attribute (or use_width is off), multiplied by point pscale
aliases: rad wire_radius
divisionsint83..1024sides around the tube
aliases: sides cols
capsbooltruecap the tube ends
use_widthbooltrueuse point "width" attribute (diameter) when present; pscale is then ignored
trim_bandstring""trim sheet band (or rectangle) to map onto ("" = the node's own uv): u runs along the path at the band's period, v fills the band across the tube's circumference. A comma list ("stone, coping") gives one band per segment of the tube's circumference, cycled. "sheet:band" picks a sheet when several are carried. Help topic trim_sheets.
aliases: trim
trim_aroundenum"wrap"wrap: consecutive segments of the tube's circumference on the same band share it by length (one band wrapped round); faces: every segment fills the whole band
options: wrap faces
trim_capstring""band for the caps at real size ("" = the sheet's first band of kind cap, else the first trim_band)
trim_offsetfloat0shift u along the path, metres (staggers the joints of pieces side by side)

Writes: vertex uv; prim groups caps, sides; with trim_band: prim trim_band, trim_sheet and detail trim_sheets

Example

{
  "nodes": {
    "tree": { "type": "lsystem", "params": { "generations": 4 } },
    "branches": {
      "type": "polywire",
      "in": ["tree"],
      "params": { "divisions": 6 }
    }
  },
  "output": "branches"
}

Used in the examples corridor_panels, stair_flight.

project_curve#

aliases: curve_project ray_curve projectcurve

Project curves onto a surface or heightfield (along a direction or to the closest point): roads and paths on terrain.

Houdini Ray SOP applied to curves. Optionally resamples each curve by spacing first (splines exactly), so the projected curve follows the surface between the original points. direction mode casts rays (both ways with bidirectional); closest snaps to the nearest surface point. Writes point hit (1/0) and N (surface normal at the hit); misses stay where they are or are deleted. lift raises the result along the normal. Targets: polygons (input 1), or a heightfield (sampled exactly for vertical rays, through its preview mesh otherwise). sample picks the heightfield surface for vertical rays: bilinear, or unreal_triangles (each cell split along its (0,0)–(1,1) diagonal in heightmap index space, column = X, row = Z: the surface of an Unreal Landscape imported from the field's png16/r16 export), so a road lies exactly on the Landscape.

Inputs

#namedescription
0curvescurves (or points) to project
1targetsurface mesh or heightfield

Parameters

nametypedefaultrangedescription
modeenum"direction"rays along direction, or the closest surface point
options: direction closest
directionvec3[0,-1,0]ray direction (mode direction)
aliases: dir
bidirectionalbooltruealso cast the opposite direction (the nearer hit wins)
spacingfloat00..resample curves to this segment length first (0 = keep the points)
aliases: resample length
liftfloat0offset from the surface along its normal
max_distancefloat10000000000..ignore hits further than this
missesenum"keep"points without a hit: stay where they are (hit 0) or are deleted
options: keep delete
normalsbooltruewrite point N from the surface
smooth_normalsbooltrueN (and lift) from the interpolated vertex normals of the surface (60° cusp); false = the normal of the hit face
groupgroup (point)""point group pattern to affect ("" = all). e.g. "top", "!top", "0-9", "@P.y>0"
sampleenum"bilinear"heightfield target, vertical rays: bilinear, or unreal_triangles = Unreal Landscape's triangles (each cell cut along its (0,0)–(1,1) diagonal in heightmap index space, column = X, row = Z)
options: bilinear unreal_triangles
aliases: sampling sample_mode

Writes: point hit (int), N (surface normal)

Example

{ "type": "project_curve", "params": { "spacing": 0.25, "lift": 0.05 } }

resample#

Resample curves (and polygon outlines) to even spacing; optional smoothing. Adds curveu.

Bezier/NURBS prims are sampled on the true curve, evenly by arc length (treat_splines "exact"; their CV attributes are blended with the curve's own basis weights), or along their control polygon ("control_polygon"); either way the result is a polyline.

Inputs

#namedescription
0curvespolylines, polygons or Bezier/NURBS curves

Parameters

nametypedefaultrangedescription
modeenum"length"segment length or a fixed segment count per curve
options: length count
lengthfloat0.10.000001..target segment length
aliases: seglen segment_length
countint201..1000000segments per curve (mode=count)
aliases: segments
smoothboolfalseCatmull-Rom smooth before resampling (polylines)
groupgroup (prim)""prim group pattern to affect ("" = all). e.g. "top", "!top", "0-9", "@P.y>0"
tangentboolfalsealso write point tangentu (unit tangent)
treat_splinesenum"exact"Bezier/NURBS prims: sample the curve itself by arc length (exact) or their control polygon as a polyline
options: exact control_polygon

Writes: point curveu (0..1 along each curve), optional tangentu

Example

{
  "nodes": {
    "path": {
      "type": "curve",
      "params": { "points": [[0, 0, 0], [3, 0, 2], [6, 0, 0]] }
    },
    "even": {
      "type": "resample",
      "in": ["path"],
      "params": { "length": 0.25, "smooth": true, "tangent": true }
    }
  },
  "output": "even"
}

Used in the examples asset_cleanup, guided_town.

revolve#

aliases: lathe

Lathe: revolve profile curves around an axis (Y through the origin by default). Profiles touching the axis close up.

Each profile point turns around the axis line (through origin, along axis) at its own distance from it, so the profile can be drawn in any plane that holds the axis: the XY plane (x = radius) for the default Y axis, the XY plane (y = radius) for axis [1, 0, 0]. angle is measured from where the profile is drawn, turning counter-clockwise when the axis points at the viewer, so the plan angle of the result (atan2(z, x) seen from +Y) is minus the angle: a 0..90 revolve about Y ends at -90 in plan, towards -Z. Closed solids always face outward and flip has no effect on them: a closed profile turned a full 360, a closed profile over a partial angle with caps on (the caps are wound with the sides, for any angle and either profile direction), and a profile whose open ends both lie on the axis turned a full 360. Caps are only made for closed profiles. Every other result is an open surface whose facing follows the profile direction and the sign of the angle span: if it faces the wrong way, set flip.

Inputs

#namedescription
0profilecurves in a plane holding the axis (default: the XY plane, x = distance from the Y axis)

Parameters

nametypedefaultrangedescription
axisvec3[0,1,0]direction of the axis to turn around
aliases: direction dir
originvec3[0,0,0]a point on the axis
aliases: center pivot
segmentsint323..4096segments around
aliases: divisions cols
anglevec2[0,360]start/end angle in degrees, counter-clockwise seen from the axis tip (right-handed): 0..90 about Y runs from +X towards -Z
capsboolfalsecap partial revolves of closed profiles, making a closed solid that faces outward (open profiles get no caps)
flipboolfalsereverse face orientation of an open result; no effect on a closed solid (always faces outward)

Writes: vertex uv

Example

{
  "nodes": {
    "profile": {
      "type": "curve",
      "params": {
        "points": [
          [0, 0, 0],
          [0.4, 0, 0],
          [0.25, 0.6, 0],
          [0.45, 1.2, 0],
          [0, 1.2, 0]
        ],
        "smooth": true
      }
    },
    "vase": {
      "type": "revolve",
      "in": ["profile"],
      "params": { "segments": 48 }
    }
  },
  "output": "vase"
}

Used in the examples asset_cleanup, rusty_drum.

shape2d#

aliases: rect rectangle ngon star polygon2d

Flat 2D shapes as closed polygons: rect, rounded_rect, capsule (slot), ngon, star, gear, cross, L, U.

Inputs

None (generator).

Parameters

nametypedefaultrangedescription
shapeenum"rect"shape type; capsule and slot are the same stadium: a rect whose short ends are half circles
options: rect rounded_rect capsule slot ngon star gear cross L U
sizevec2[1,1]rect/rounded_rect/capsule/slot/cross/L/U: width and depth (overall, ends included)
radiusfloat0.5ngon/star/gear: outer radius
inner_radiusfloat0.25star/gear: inner radius
sidesint63..100000ngon sides / star points / gear teeth
aliases: points teeth
corner_radiusfloat0.10..rounded_rect corner radius
corner_segmentsint61..10000rounded_rect/capsule/slot: segments per quarter circle
thicknessfloat0.25cross/L/U arm thickness
rotatefloat0rotation in degrees within the plane
planeenum"xz"orientation plane (xz = ground, facing +Y; xy = facing +Z; yz = facing +X)
options: xz xy yz
centervec3[0,0,0]center position
aliases: t translate position pos origin

Example

{
  "type": "shape2d",
  "params": { "shape": "gear", "radius": 1, "inner_radius": 0.8, "sides": 16 }
}

Used in the examples cloth_drape, lsystem_tree, scifi_panel.

spiral#

aliases: helix

Helix / spiral curve rising along +Y.

Inputs

None (generator).

Parameters

nametypedefaultrangedescription
radiusfloat1start radius
radius_endfloat-1end radius (-1 = same as radius)
heightfloat2total rise
turnsfloat3number of turns
points_per_turnint323..100000resolution
clockwiseboolfalseturn direction when seen from above
centervec3[0,0,0]center position
aliases: t translate position pos origin

Example

{
  "type": "spiral",
  "params": { "radius": 1, "radius_end": 0.3, "height": 3, "turns": 5 }
}

spline_fit#

aliases: fit_curve curve_fit fitcurve

Least-squares NURBS through ordered points: smooth noisy polylines, compress dense curves to few CVs.

Houdini Fit SOP (approximation). Each polyline/polygon (or, without prims, all points in order) is approximated by a B-spline: cv_count CVs, or (cv_count 0) the fewest CVs that keep every point within tolerance (interpolating at worst). Open curves keep their end points. smoothing adds a penalty on the CVs' second differences (0 = none; around 1 irons out noise; larger flattens). Parameters are corrected (re-projected) twice. Output NURBS prims, or polylines sampled from the fit. Writes prim fit_error.

Inputs

#namedescription
0pointspolylines/polygons (each fitted), or ordered points without prims (one curve)

Parameters

nametypedefaultrangedescription
orderint42..11order of the fitted curve (4 = cubic)
cv_countint00..100000number of CVs; 0 = as few as the tolerance allows
aliases: cvs count
tolerancefloat0.010..largest allowed distance from a point to the curve (cv_count 0)
aliases: tol max_error
smoothingfloat00..second-difference penalty on the CVs (0 = none, ~1 smooths noise)
aliases: smooth
parameterizationenum"centripetal"parameterisation: uniform (even), chord (follows point distances), centripetal (√distances; best for sharp turns)
options: uniform chord centripetal
closedenum"auto"auto = as the input prim (open for point clouds)
options: auto open closed
outputenum"nurbs"NURBS prims or polylines sampled from the fit
options: nurbs polyline
segmentsint00..10000polyline output: segments per knot span; 0 = adaptive (tolerance / 4)
groupgroup (prim)""prim group pattern to affect ("" = all). e.g. "top", "!top", "0-9", "@P.y>0"

Writes: prim fit_error (largest distance from an input point to the fitted curve)

Example

{
  "nodes": {
    "spiral": {
      "type": "spiral",
      "params": { "turns": 1.5, "points_per_turn": 40 }
    },
    "noisy": {
      "type": "jitter",
      "in": ["spiral"],
      "params": { "amount": 0.04 }
    },
    "fit": {
      "type": "spline_fit",
      "in": ["noisy"],
      "params": { "tolerance": 0.1, "smoothing": 1 }
    }
  },
  "output": "fit"
}

straight_skeleton#

Straight skeleton, polygon offsets and pitched roofs from planar footprints, including holes.

Input closed polygons lie on XZ at a constant Y. Containment uses even/odd nesting to detect holes, including doubled bridges in one primitive. Each shape (an outer contour and its holes) is processed on its own, so separate shapes may share edges and corners, as lots split from one block do; a hole must lie strictly inside its outer contour, and no two contours may cross. Positive offset distances move inward. Roof pitch attributes use the outgoing edge of each point (or one pitch for the whole source primitive). Output edge numbers follow input primitive and corner order. Straight and doubled corners (within 1e-5 of the shape's extent of the line between their neighbours) are dropped before the skeleton when the edges around them have the same pitch: one roof face spans them, its eave still runs through every footprint point, and its edge number is the first of the merged edges.

Inputs

#namedescription
0footprintClosed planar footprints, with nested contours for holes.

Parameters

nametypedefaultrangedescription
modeenum"skeleton"Emit skeleton and contour arcs, offset contours, or roof faces.
options: skeleton offset roof
distancefloat0.2Offset distance in metres: positive inward, negative outward.
pitchfloat300.01..90Roof pitch in degrees (greater than 0, up to 90 for a gable); overridden by pitch_attrib when set.
pitch_attribstring""Scalar point or primitive pitch attribute, in degrees; point values belong to outgoing edges.
height_capfloat00..Maximum roof height above the footprint; 0 leaves the ridge uncapped.
groupgroup (prim)""Footprint primitives to process; unselected primitives pass through.

Writes: Skeleton: prim int kind (0 skeleton, 1 contour). Roof: prim int edge (input contour edge; -1 for a height cap). Source attributes and groups follow contour provenance.

Example

{
  "nodes": {
    "footprint": {
      "type": "curve",
      "params": {
        "closed": true,
        "points": [
          [0, 0, 0],
          [6, 0, 0],
          [6, 0, 2],
          [2, 0, 2],
          [2, 0, 5],
          [0, 0, 5]
        ]
      }
    },
    "roof": {
      "type": "straight_skeleton",
      "in": ["footprint"],
      "params": { "mode": "roof", "pitch": 35 }
    }
  },
  "output": "roof"
}

Used in the example town_from_lots.

sweep#

Sweep a cross-section along curves using rotation-minimising frames (tubes, ribbons, rails, mouldings).

The profile is drawn in the XY plane around the origin, looking along the curve: at every curve point it is placed with its +Z along the curve (the direction of travel), its +Y on the up direction (the "up" param, or the point attribute up) kept perpendicular to the curve, and its +X = Y × Z, to the left of the direction of travel when up points up. The frame then turns as little as possible from point to point (rotation-minimising), so a flat ribbon does not twist on its own; twist adds a turn. The built-in ribbon faces the frame's +Y, which is up on a level path with the default up. The sides are wound so a closed profile drawn counter-clockwise (seen from +Z) faces outward; caps on open curves face away from the curve. The end caps lie in the profile plane, perpendicular to the curve at its last point: where the last segment is tilted, the cap is tilted with it and its rim pokes above or below a horizontal plane the tube was meant to end on (a ground or snap plane). End the path with a short horizontal run, or cut the result with clip. uv: u runs around the profile, v along the curve; caps take the profile's flat layout.

Inputs

#namedescription
0backbonecurves to sweep along (Bezier/NURBS curves are sampled adaptively)
1profilecross-section curve drawn in the XY plane (optional; one per backbone or a single shared one) (optional)
2sheettrim sheet for trim_band (a trim_sheet node; optional: else the one the backbone carries) (optional)

Parameters

nametypedefaultrangedescription
shapeenum"circle"built-in profile when no profile input; rect is size wide (X) and high (Y), for straps and bars
options: circle square rect ribbon half_circle
radiusfloat0.1built-in profile radius / half width
aliases: width rad
sizevec2[0.2,0.05]rect profile: width along the profile X (sideways) and height along Y (up)
divisionsint121..1024built-in profile segments (equal strips across a ribbon); minimum 1 for ribbon, 2 for other shapes; square and rect use four sides
aliases: sides cols
capsbooltruecap open ends (closed profiles only)
twistfloat0total twist in degrees along each curve
scale_rampramp[[0,1],[1,1]]profile scale along the curve (u 0..1); point pscale also multiplies
upvec3[0,1,0]initial up vector (point attribute "up" overrides per point)
uv_lengthboolfalsev coordinate in world length instead of 0..1
trim_bandstring""trim sheet band (or rectangle) to map onto ("" = the node's own uv): u runs along the path at the band's period, v fills the band across the profile. A comma list ("stone, coping") gives one band per segment of the profile, cycled. "sheet:band" picks a sheet when several are carried. Help topic trim_sheets.
aliases: trim
trim_aroundenum"wrap"wrap: consecutive segments of the profile on the same band share it by length (one band wrapped round); faces: every segment fills the whole band
options: wrap faces
trim_capstring""band for the caps at real size ("" = the sheet's first band of kind cap, else the first trim_band)
trim_offsetfloat0shift u along the path, metres (staggers the joints of pieces side by side)

Writes: vertex uv; prim groups caps, sides; with trim_band: prim trim_band, trim_sheet and detail trim_sheets

Example

{
  "nodes": {
    "path": {
      "type": "curve",
      "params": {
        "points": [[0, 0, 0], [1, 1, 0], [3, 1.5, 1], [4, 3, 1]],
        "smooth": true
      }
    },
    "horn": {
      "type": "sweep",
      "in": ["path"],
      "params": {
        "radius": 0.3,
        "divisions": 16,
        "scale_ramp": [[0, 1], [1, 0.1]]
      }
    }
  },
  "output": "horn"
}

Used in the examples eroded_valley, lsystem_tree, rail_along_curve, unreal_landscape.

trace_image#

Trace a thresholded image into closed XY contours, with holes and disconnected components.

Traces pixel-cell boundaries (not a bounding rectangle). Foreground is 4-connected: diagonal contacts stay separate. Simplification is conservative, topology-preserving, and bounded by tolerance in pixels. min_area filters entire foreground components by pixel area, retaining their holes. The full canvas maps to [0,width] × [0,widthheight/widthPixels] in XY, including transparent margins. After fill use uv_project {method:"planar",axis:"z",scale:[width,widthheightPixels/widthPixels]}; fill does not preserve contour attributes. More than 1,000,000 boundary edges fails with a hint.

Inputs

#namedescription
0imagegeometry carrying the image to trace

Parameters

nametypedefaultrangedescription
imagestring""which image of the input to use ("" = its only image; needed when it holds several)
aliases: input_image source_image
layerstring""layer name (empty selects the main layer)
channelenum"alpha"channel to read; alpha requires RGBA, luminance/R/G/B accept grey
options: alpha luminance r g b
thresholdfloat0.5values at least this threshold are foreground
tolerancefloat0.50..8192maximum contour simplification error in source pixels; 0 only removes collinear points
min_areafloat00..16777216minimum connected foreground component area in pixels; 0 retains all components
extentfloat00..full image canvas width in metres; height follows image aspect (0 = the metres the image states it covers: texture_size set on its generator, or a bake; refused when it states none)

Writes: closed curves; point uv; prim class (component ID), contour_id and hole (0/1); detail image_size and image_width

Example

{
  "nodes": {
    "img": {
      "type": "tex_shape",
      "params": {
        "resolution": [64, 32],
        "texture_size": 1,
        "shape": "disc",
        "falloff": 0
      }
    },
    "out": {
      "type": "trace_image",
      "in": ["img"],
      "params": { "channel": "luminance" }
    }
  },
  "output": "out"
}

Used in the example image_cutouts.

triangulate2d#

aliases: delaunay triangulate_2d

Delaunay-triangulate points projected on a plane (keeps 3D positions) — terrain from point samples, meshes from scatters.

Inputs

#namedescription
0pointspoints

Parameters

nametypedefaultrangedescription
planeenum"xz"orientation plane (xz = ground, facing +Y; xy = facing +Z; yz = facing +X)
options: xz xy yz
max_edgefloat00..drop triangles with an edge longer than this (0 = keep all)

Example

{
  "nodes": {
    "pts": {
      "type": "point_grid",
      "params": { "counts": [12, 1, 12], "size": [10, 0, 10], "jitter": 0.4 }
    },
    "hills": {
      "type": "noise_displace",
      "in": ["pts"],
      "params": { "mode": "direction", "amplitude": 1, "frequency": 0.3 }
    },
    "mesh": {
      "type": "triangulate2d",
      "in": ["hills"],
      "params": { "max_edge": 2 }
    }
  },
  "output": "mesh"
}

voronoi2d#

aliases: voronoi_cells voronoi_2d

2D Voronoi cells around points (on a plane), clipped to a rectangle; site attributes copied to cells. City blocks, cracks, tiles.

Inputs

#namedescription
0sitespoints (optional: random sites are generated) (optional)

Parameters

nametypedefaultrangedescription
countint301..100000random sites when no input
sizevec2[10,10]clip rectangle size (centered at center); [0,0] = sites bbox + 10%
centervec3[0,0,0]center position
aliases: t translate position pos origin
planeenum"xz"orientation plane (xz = ground, facing +Y; xy = facing +Z; yz = facing +X)
options: xz xy yz
insetfloat00..shrink each cell (gap between cells)
relaxint00..50Lloyd relaxation iterations (more even cells)
seedfloat0random seed

Writes: closed polygons with prim class (cell id) and site attributes

Example

{
  "type": "voronoi2d",
  "params": {
    "count": 40,
    "size": [20, 20],
    "inset": 0.2,
    "relax": 2,
    "seed": 1
  }
}

Used in the example town_from_lots.