transform nodes

3 node types in the transform category.

match_size#

aliases: matchsize fit align center

Align / fit the bounding box: e.g. sit on the ground (justify y=min), center, or scale to a target size.

Inputs

#namedescription
0geogeometry to move
1referenceoptional geometry to match (its bbox becomes the target) (optional)

Parameters

nametypedefaultrangedescription
justifyjson["center","min","center"]per axis X,Y,Z: "min" | "center" | "max" | "none". Default sits the object centered on the ground.
targetvec3[0,0,0]target position for the justified bbox points
scale_to_fitboolfalsescale uniformly so the largest dimension equals target_size
target_sizefloat1size for scale_to_fit

Example

{
  "type": "match_size",
  "params": {
    "justify": ["center", "min", "center"],
    "scale_to_fit": true,
    "target_size": 2
  }
}

Used in the examples asset_cleanup, growth, machined_bracket, rail_along_curve.

mirror#

Mirror across a plane; optionally keep the original and weld the seam.

Inputs

#namedescription
0geogeometry

Parameters

nametypedefaultrangedescription
axisenum"x"mirror plane normal axis
options: x y z custom
normalvec3[1,0,0]custom plane normal
originvec3[0,0,0]point on the mirror plane
keep_originalbooltrueoutput original + mirrored copy
fusefloat0.000010..weld points on the seam within this distance (0 = off)

Example

{
  "nodes": {
    "box": { "type": "box", "params": { "divisions": [2, 2, 2] } },
    "half": {
      "type": "clip",
      "in": ["box"],
      "params": { "normal": [1, 0, 0], "keep": "below" }
    },
    "both": { "type": "mirror", "in": ["half"], "params": { "axis": "x" } }
  },
  "output": "both"
}

Used in the example blob_creature.

transform#

aliases: xform move rotate scale

Translate / rotate (degrees) / scale about a pivot. Also transforms N, v, up, orient, SDF volumes and packed instances.

Inputs

#namedescription
0geogeometry to transform

Parameters

nametypedefaultrangedescription
translatevec3[0,0,0]translation
aliases: t move offset position
rotatevec3[0,0,0]rotation in degrees about the world X, Y and Z axes, right-handed (counter-clockwise seen from the + end of the axis), X first, then Y, then Z (rotate_order xyz): [0, 0, 40] turns +Y to (-0.64, 0.77, 0), [0, 90, 0] turns +X to -Z
aliases: r rot rotation
scalevec3[1,1,1]scale (a single number = uniform)
aliases: s
uniform_scalefloat1extra uniform scale multiplier
aliases: uniformscale scale_uniform
pivotvec3[0,0,0]pivot for rotation and scale
aliases: p
pivot_modeenum"param"where the pivot comes from
options: param centroid bbox_min bbox_center_bottom
orderenum"srt"transform order (srt = scale, then rotate, then translate)
options: srt str rst rts tsr trs
aliases: xord
rotate_orderenum"xyz"order the three rotations apply in, each about a world axis: xyz = X first, then Y, then Z
options: xyz xzy yxz yzx zxy zyx
aliases: rord
groupgroup (point)""point group to transform ("" = all)

Example

{
  "type": "transform",
  "params": { "translate": [0, 1, 0], "rotate": [0, 45, 0], "uniform_scale": 2 }
}

Used in the examples asset_cleanup, blob_creature, cloth_drape, eroded_valley, image_cutouts, lsystem_tree, machined_bracket, market_street, material_set, ocean_surface, rail_along_curve, scifi_panel, terrain_tiles, weathered_cabinet, worn_machine.