Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

geometry.loft

Bridge two or more cross-sections, in the order given, into one surface. Rings of differing point counts are resampled by arc length to the densest, or refused, per mismatch; with align each ring after the first is lined up with the one before it, by reversing and rotating its points to where the two rings stand closest together; the faces wind outward whichever way the profiles were authored. Each point carries uv (x around the ring, y along the run, each 0 to 1), t (the run, 0 to 1) and ringU (around the ring, 0 to 1); the result is shaded with point normals and numbered by id. Fewer than two profiles are refused.

Inputs

  • profiles (List<Geometry>). The cross-sections, each a geometry holding one curve (its points are the ring) or faces (their boundary is the ring), in the order they are bridged.
  • align (Bool, default true). true lines each ring up with the one before it; false takes the points in the order they come.
  • caps (Bool, default false). true closes both ends with the outline of the first and last cross-section.
  • closed (Bool, default false). true bridges the last cross-section back to the first, so the loft is a loop.
  • mismatch (String, default "resample", one of "resample", "error"). What happens when the cross-sections hold different numbers of points: "resample" spaces every ring evenly by arc length to the densest count, "error" refuses.

Outputs

  • geometry (Geometry). The lofted surface.
local bottom = g.curve.circle({ radius = 1, segments = 16 })
local top = g.geometry.transform({ geometry = g.curve.circle({ radius = 0.5, segments = 8 }), translate = vector.create(0, 2, 0) })
local funnel = g.geometry.loft({ profiles = { bottom, top }, caps = true })