Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

curve

Curves as geometry. A curve is a primitive of a Geometry: a run of its points, in order, open or closed, that is a line rather than a surface. A mesh built from the geometry draws its faces and not its curves. The curve's points are points like any other, so every point and field op moves them. One geometry holds any number of curves (the branches of a crack, the strands of a bolt), and the ops that sample, sweep or grow along lines read every one.

The definitions live in proc.ops.curves; this pack is what puts them in the op registry, so procgen.searchNodes("", { pack = "curve" }) lists the family and procgen.describeNode("op.<id>") describes any one of them.

Ops

  • curve.line — a straight curve from start to finish, in segments spans.
  • curve.circle — a closed circular curve in the XZ plane.
  • curve.bezier — a cubic Bézier curve from four control points.
  • curve.from_points — one curve through a geometry's points, in their order; the points keep every attribute they carry.
  • curve.smooth — every curve rounded into a Catmull-Rom spline through its own points.
  • curve.resample — every curve laid out again with points evenly spaced by arc length, a set number per curve or as many as a spacing fits.

Move curves with geometry.transform, displace them with geometry.set_position and a field, and join them with geometry.append. points.on_curve samples points along them, and geometry.sweep carries a cross-section along each one.