generate nodes

13 node types in the generate category.

beam#

aliases: strut post rafter joist brace member lumber girder beams

Beams between two points, between point pairs or along every segment of curves: a rectangle (or any closed profile on input 1) swept straight, with an up vector, caps, uv in metres and a prim name. Posts, rafters, joists, struts, trusses.

Without input 0 one beam runs from start to end. With input 0 every segment of its curves (polylines, and the edges of polygons) becomes a beam (from "segments"), or, for points only, each consecutive pair (0-1, 2-3 …: from "pairs"); "auto" picks segments when there are curves. The profile lies across the beam: its first axis runs to the side, its second along up projected square to the beam (a beam along up takes +Z, else +X, as up), then roll turns it about the beam. The default profile is a size[0] × size[1] rectangle (width to the side, height up), centred on the line; offset shifts it (offset [0, size[1] / 2] puts the line along the bottom face, e.g. joists resting on a line). A closed curve on input 1 replaces it, drawn flat in any plane (shape2d's XZ: x to the side, -z up; XY: x to the side, y up): an I-beam, a channel, a round bar; every closed loop is swept, each capped on its own (switch caps off for hollow sections). extend lengthens the start and end (negative shortens, e.g. by half a post's width). uv: along the beam (u) and around the profile (v) in metres × uv_scale; caps are mapped flat. Point attributes of the input (Cd, …) are blended along each beam and prim attributes copied from the curve a beam follows; name (with {index} for the beam number) names every beam's prims, "" keeps the curve's name.

Inputs

#namedescription
0pathoptional: curves (each segment a beam) or points (pairs); else start → end (optional)
1profileoptional: a closed cross-section curve, drawn flat (else the size rectangle) (optional)

Parameters

nametypedefaultrangedescription
startvec3[0,0,0]start point when input 0 is not connected
aliases: from p0 a
endvec3[0,3,0]end point when input 0 is not connected
aliases: to p1 b
fromenum"auto"input 0: every curve segment, or consecutive point pairs (auto: segments when there are curves)
options: auto segments pairs
aliases: mode
sizevec2[0.1,0.2]0..rectangle profile [width to the side, height up] in metres
aliases: section dimensions
upvec3[0,1,0]which way the profile's second axis (the height) faces, projected square to the beam
aliases: up_vector
rollfloat0turn the profile about the beam, degrees
offsetvec2[0,0]shift of the profile [to the side, up] in metres (the line is its origin)
extendvec2[0,0]lengthen [start, end] along the beam in metres (negative shortens)
aliases: overhang extension
divisionsint11..1000segments along the length (for later bending)
aliases: segments rows
capsbooltrueclose both ends
aliases: cap end_caps
uv_scalefloat10..uv units per metre (uv in metres at 1)
namestring"beam"prim name of every beam ({index} = the beam number; "" = keep the input curve's name)
aliases: prim_name

Writes: polygons; prim groups sides, caps; prim string name, prim int beam (the beam number); vertex uv

Example

{
  "nodes": {
    "frame": {
      "type": "curve",
      "params": { "points": [[0, 0, 0], [0, 2.4, 0], [3, 2.4, 0], [3, 0, 0]] }
    },
    "posts": {
      "type": "beam",
      "in": ["frame"],
      "params": {
        "size": [0.12, 0.12],
        "up": [0, 0, 1],
        "name": "timber_{index}"
      }
    }
  },
  "output": "posts"
}

box#

aliases: cube

Axis-aligned box (watertight quads, optional divisions, box-mapped uv).

Inputs

None (generator).

Parameters

nametypedefaultrangedescription
sizevec3[1,1,1]edge lengths X Y Z (a single number = uniform)
aliases: scale dims
centervec3[0,0,0]center position
aliases: t translate position pos origin
divisionsivec3[1,1,1]1..512quads along X Y Z
aliases: divs div

Writes: vertex uv

Example

{ "type": "box", "params": { "size": [2, 1, 1], "center": [0, 0.5, 0] } }

Used in the examples cloth_drape, corridor_panels, fracture_settle, market_street, material_set, rail_along_curve, scifi_panel, stair_flight, weathered_cabinet, worn_machine.

grid#

Flat grid of quads (default lies on the XZ ground plane facing +Y).

Inputs

None (generator).

Parameters

nametypedefaultrangedescription
sizevec2[4,4]width and depth
divisionsivec2[10,10]1..2048quads along each side
aliases: rows cols res resolution
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

Writes: point uv

Example

{ "type": "grid", "params": { "size": [10, 6], "divisions": [20, 12] } }

Used in the examples cloth_drape, guided_town, market_street, ocean_surface, town_from_lots, weathered_cabinet.

lsystem#

aliases: l_system turtle plant tree

Lindenmayer system: grammar rewriting + 3D turtle → branching curves (with width) and leaf points. Plants, trees, fractals.

Turtle starts at the origin heading +Y. Symbols: F/G draw forward, f/g move without drawing, + - yaw, & ^ pitch, \ / roll, | turn around, [ ] push/pop branch, ! shrink width (width_scale), " scale step (step_scale), J K M emit leaf points (groups J/K/M + leaves) with N/up/orient/pscale. A number in parentheses overrides the step or angle: F(0.5) +(10). Rules: {"F": "FF-[-F+F]+[+F-F]"}; stochastic: {"F": [["F[+F]F", 0.6], ["F[-F]F", 0.4]]}.

Inputs

None (generator).

Parameters

nametypedefaultrangedescription
axiomstring"A"start string
aliases: premise start
rulesjson{"A":"F[&+A][&-A][^A]","F":"F"}rewrite rules: {symbol: replacement} or {symbol: [[replacement, weight], ...]}
generationsint50..16rewrite iterations
aliases: iterations depth
anglefloat28turn angle in degrees
stepfloat0.3forward step length
aliases: length step_size
step_scalefloat0.9multiplier applied by "
widthfloat0.08initial branch diameter (point attribute width)
width_scalefloat0.7multiplier applied by !
auto_taperbooltruealso shrink width and step on each [ branch
branch_scalefloat0.85auto_taper step multiplier per branch level
angle_variancefloat00..random ± degrees added to every turn
step_variancefloat00..1random ± fraction on every step
tropismvec3[0,-1,0]bending direction (e.g. gravity)
tropism_strengthfloat0bending amount per step (0 = off; ~0.05-0.3)
seedfloat0random seed
max_lengthint4000001..50000000safety cap on the expanded string length

Writes: polylines with point width/depth, prim depth; leaf points in groups leaves, J, K, M with N, up, orient, pscale

Example

{
  "type": "lsystem",
  "params": {
    "generations": 4,
    "angle": 25,
    "tropism_strength": 0.1,
    "seed": 2
  }
}

Used in the example lsystem_tree.

parametric_surface#

Surface from a JS expression of (u, v) returning [x,y,z]; optional wrapping for closed surfaces.

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

Inputs

None (generator).

Parameters

nametypedefaultrangedescription
exprcode"[(1+0.5*cos(v*TAU))*cos(u*TAU), 0.5*sin(v*TAU), (1+0.5*cos(v*TAU))*sin(u*TAU)]"JS expression of u, v returning [x,y,z]
u_rangevec2[0,1]u start/end
v_rangevec2[0,1]v start/end
divisionsivec2[48,24]1..2048quads along u and v
wrap_uboolfalseu is periodic: join last column to first (no seam)
wrap_vboolfalsev is periodic
flipboolfalsereverse face winding

Writes: vertex uv

Example

{
  "type": "parametric_surface",
  "params": {
    "expr": "[(u - 0.5) * 4, 0.25 * sin(u * TAU * 2), (v - 0.5) * 2]",
    "divisions": [64, 16]
  }
}

platonic#

Platonic solids: tetrahedron, cube, octahedron, dodecahedron, icosahedron.

Inputs

None (generator).

Parameters

nametypedefaultrangedescription
shapeenum"icosahedron"solid type
options: tetrahedron cube octahedron dodecahedron icosahedron
radiusfloat1circumradius
centervec3[0,0,0]center position
aliases: t translate position pos origin

Example

{ "type": "platonic", "params": { "shape": "dodecahedron", "radius": 0.5 } }

point_grid#

aliases: lattice_points points_from_volume

3D lattice of points (optionally jittered) — e.g. for scattering, voxel art, instancing.

Inputs

None (generator).

Parameters

nametypedefaultrangedescription
countsivec3[5,1,5]1..100000points along X Y Z
sizevec3[4,0,4]extent along X Y Z
centervec3[0,0,0]center position
aliases: t translate position pos origin
jitterfloat00..random offset as a fraction of the spacing
seedfloat0random seed

Example

{
  "type": "point_grid",
  "params": {
    "counts": [10, 1, 10],
    "size": [9, 0, 9],
    "jitter": 0.3,
    "seed": 1
  }
}

points#

aliases: add point

Explicit points (and optional per-point attributes) from lists. No primitives.

Inputs

None (generator).

Parameters

nametypedefaultrangedescription
positionsjson[[0,0,0]]list of [x,y,z] (2-number entries are placed on the ground: [x, 0, z])
aliases: points pts P
attribsjson{}per-point attributes: {"pscale": [1, 0.5], "Cd": [[1,0,0],[0,1,0]], "name": ["a","b"]}
polylineenum"none"also connect the points as a polyline / polygon
options: none open closed

Example

{
  "type": "points",
  "params": {
    "positions": [[0, 0, 0], [1, 0, 0], [1, 1, 0]],
    "attribs": { "pscale": [1, 2, 3] }
  }
}

Used in the examples cloth_drape, fracture_settle, market_street, rail_along_curve, scifi_panel, sparks.

sphere#

Sphere: polar uv-sphere, geodesic icosphere, or quad sphere. Watertight, with point normals.

Inputs

None (generator).

Parameters

nametypedefaultrangedescription
typeenum"uv"uv = latitude/longitude, ico = geodesic triangles, quad = spherified cube
options: uv ico quad
radiusfloat10..radius
aliases: rad r
scalevec3[1,1,1]non-uniform scale (ellipsoid)
centervec3[0,0,0]center position
aliases: t translate position pos origin
rowsint162..2048uv: latitude bands
colsint323..2048uv: longitude segments
aliases: columns segments
levelint30..7ico: subdivision level (20*4^level triangles)
aliases: frequency subdivisions
divisionsint81..512quad: quads per cube-face edge

Writes: point N; uv (uv type)

Example

{
  "type": "sphere",
  "params": { "type": "quad", "radius": 0.5, "divisions": 6 }
}

Used in the examples asset_cleanup, blob_creature, growth.

terrain#

aliases: landscape

Terrain mesh: a ground grid displaced by fractal noise, with height attribute and normals (for erosion, masks and Unreal heightmaps use the heightfield nodes).

Inputs

None (generator).

Parameters

nametypedefaultrangedescription
sizevec2[20,20]extent in X and Z
divisionsivec2[128,128]1..2048grid resolution (quads)
aliases: resolution res
heightfloat3vertical scale (amplitude)
aliases: amplitude amp
frequencyfloat0.12base noise frequency (features per unit)
aliases: freq
noiseenum"simplex"base noise
options: perlin simplex value worley
fractalenum"fbm"layering mode (ridged = mountain ridges)
options: fbm ridged turbulence none
octavesint61..12fractal octaves
roughnessfloat0.5amplitude gain per octave
lacunarityfloat2frequency gain per octave
offsetvec3[0,0,0]noise space offset (scroll the terrain)
terracefloat00..terrace step height (0 = off)
floorfloat-1000000000clamp heights below this (flat water/valley floor)
fallofffloat00..1island falloff: lower the edges (0 = off, 1 = strong)
seedfloat0random seed
centervec3[0,0,0]center position
aliases: t translate position pos origin

Writes: point height (0..1), point N, point uv

Example

{
  "type": "terrain",
  "params": {
    "size": [40, 40],
    "divisions": [96, 96],
    "height": 6,
    "fractal": "ridged",
    "falloff": 0.5,
    "seed": 3
  }
}

text#

aliases: font type lettering

Text from a TrueType/OpenType font: filled faces, outlines, or an extruded solid, in the XY plane facing +Z (a solid stands out towards +Z from its back face).

Lettering for signs, signage, labels, plaques and logos. The letters lie in the XY plane and face +Z, placed by center: x and y where align and valign put the text, z the plane of the faces and outlines, and of the back face of a solid (depth > 0), whose front face is at center z + depth. So letters on a wall at z = 0 stand out from it towards +Z; turn and move the result to face elsewhere. back false leaves the back face of a solid off (letters mounted on a wall, whose back is never seen: fewer triangles, an open solid). To engrave, set center z to minus half the depth (the letters straddle the surface) and subtract the text from the surface with boolean; to emboss, merge it onto the surface or union it. curve_segments 2 (the default) suits signs; 4 to 8 for large lettering seen up close (each step adds about a third more triangles).

Inputs

None (generator).

Parameters

nametypedefaultrangedescription
textstring"TopoTopo"text (use \n for new lines)
fontstring""font file path or system family name ("" = the bundled DejaVu Sans, identical on every machine)
sizefloat1font size (em height in units)
weightfloat4001..1000font weight on the wght axis of a variable font: 100 thin, 400 regular, 700 bold, 900 black (clamped to the range the font has, with a warning). A font without a wght axis (the bundled DejaVu Sans, a static file) is drawn at its own weight; any weight but 400 then warns
aliases: wght font_weight
alignenum"center"horizontal alignment
options: left center right
valignenum"bottom"vertical alignment
options: baseline center bottom top
depthfloat00..extrusion depth (> 0 makes a solid)
outputenum"auto"auto = solid if depth > 0, else faces
options: auto faces outlines solid
line_spacingfloat1.2line height as a multiple of size
curve_segmentsint21..32segments per glyph curve: 2 suits signs; 4 to 8 for large lettering seen up close
backbooltruesolid: its back face at center z (false leaves it off: letters on a wall, whose back is never seen; the solid is then open)
aliases: back_face
centervec3[0,0,0]position: x and y where align and valign put the text; z the plane of faces and outlines, and the back face of a solid
aliases: t translate position pos origin

Example

{ "type": "text", "params": { "text": "OPEN", "size": 0.5, "depth": 0.1 } }

Used in the example machined_bracket.

torus#

Torus (ring) around the Y axis.

Inputs

None (generator).

Parameters

nametypedefaultrangedescription
radiusfloat1major radius (center of tube)
aliases: major_radius R
radius2float0.25minor radius (tube thickness)
aliases: minor_radius tube_radius r
rowsint163..2048segments around the tube
colsint483..2048segments around the ring
centervec3[0,0,0]center position
aliases: t translate position pos origin

Writes: vertex uv

Example

{
  "type": "torus",
  "params": { "radius": 1.5, "radius2": 0.3, "rows": 12, "cols": 36 }
}

tube#

aliases: cylinder cone

Cylinder / cone / frustum along an axis, optional end caps (watertight when capped).

Inputs

#namedescription
0sheettrim sheet for trim_band (a trim_sheet node; optional) (optional)

Parameters

nametypedefaultrangedescription
radiusfloat0.50..radius (both ends unless radius_top is set)
aliases: rad r
radius_topfloat-1top radius; -1 = same as radius; 0 = cone apex
heightfloat1length along the axis
aliases: h length
rowsint11..2048segments along the axis
colsint243..2048segments around
aliases: columns segments sides
capsbooltrueclose the ends with n-gons
axisenum"y"axis direction
options: y x z
centervec3[0,0,0]center position
aliases: t translate position pos origin
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 circumference (its cols are the segments: faces gives every side the whole band). A comma list ("stone, coping") gives one band per segment of the circumference (its cols are the segments: faces gives every side the whole band), cycled. "sheet:band" picks a sheet when several are carried. Help topic trim_sheets.
aliases: trim
trim_aroundenum"wrap"wrap: consecutive segments of the circumference (its cols are the segments: faces gives every side the whole band) 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; with trim_band: prim trim_band, trim_sheet and detail trim_sheets

Example

{
  "type": "tube",
  "params": { "radius": 0.3, "radius_top": 0.1, "height": 2, "cols": 16 }
}

Used in the examples machined_bracket, rail_along_curve, rusty_drum, scifi_panel, stair_flight, weathered_cabinet, worn_machine.