Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

core.stitch (procNode)

Join consecutive rings of points with quads, and optionally close the ends with caps: the surface of a tube, a sweep or a loft.

Built from attribute.carry (the geometry's vertices and primitives followed by the new ones, which read index -1 and so carry zeros, sized by size), math operators for the quad and cap layout, and gather of the ring points. rings holds every ring end to end, size points each; a quad runs ring r point j, point j + 1, then the same two points of ring r + 1. With closed, the last point of a ring joins the first. A cap is one primitive running round a whole end ring: the first ring wound the other way, the last ring in its own order. The ring count is read back from rings.count.

Inputs

  • geometry (Geometry). The geometry holding the ring points; the quads and caps are added to it.
  • rings (Column<Int>). The point numbers of every ring, one ring after another, size points each.
  • size (Number). Default 3. At least 2. How many points each ring holds.
  • closed (Bool). Default true. Whether each ring is a loop: the last point joins the first, so a ring of k points makes k quads to the next ring instead of k - 1.
  • caps (one of none, start, end, both). Default "none". Which ends are closed by a primitive running round the end ring.

Outputs

  • geometry: the geometry with the quads and caps added.

Example

local points = g.points.grid({ countX = 4, countZ = 2 })
local rings = g.core.column({ values = { 0, 1, 2, 3, 4, 5, 6, 7 } })
local tube = g.core.stitch({ geometry = points, rings = rings, size = 4, closed = true, caps = "both" })

Two rings of four points become four quads and two caps.