Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

geometry.ribbon

A flat ribbon along every curve of a geometry, width across, lying square to up, or turned to face toward a point: a crack glowing in the ground, a trail, a beam, a road. Each curve vertex gives two points, one each side; both carry every attribute of the curve point they were laid from and s, its distance along the curve, with N the ribbon's facing, uv.x running 0 to 1 along the curve by distance and uv.y 0 or 1 across it. Each segment is two triangles carrying the primitive attributes of its curve (apart from curve, closed and length). A curve running along up turns the ribbon to the world axis square to up (+Z, or +X for an up along Z). The result is numbered by id.

Inputs

  • curve (Curves). The curves to lay ribbons along. Every curve of it gets one; its faces are left out. A geometry holding no curves is refused.
  • width (Float, default 0.1, at least 0). How wide the ribbon is.
  • taper (Float, default 0, 0 to 1). How much narrower each ribbon ends than it starts: 0 keeps the width all the way, 1 closes it to a point at the end.
  • widthBy (String, default "width"). A Float attribute of the curve points the width is multiplied by at each point, when the points carry it. An empty name reads none.
  • up (Vec3, default (0, 1, 0)). The direction the ribbon lies square to: its width spreads across the curve and across up, so the default lays it flat on level ground.
  • toward (Field<Vec3> or Vec3, optional). A point the flat side of the ribbon turns to, in place of up: a Vec3 faces every point to one place (a camera's position); a Field states the place for each point.
  • lift (Float, default 0). How far along up the ribbon is raised off its curve.

Outputs

  • geometry (Geometry). The ribbon triangles.
local road = g.geometry.ribbon({ curve = g.curve.line({ finish = vector.create(4, 0, 0), segments = 8 }), width = 0.5, lift = 0.01 })