Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

mesh.torus

A torus lying in the XZ plane, centred on the origin: 48 steps round the ring and 24 round the tube, with smooth normals. Use it for rings, tyres and halos.

radius is the outer radius: the tube's radius is 0.3 of it and its centre line runs at 0.7 of it, so the torus spans 2 * radius across and 0.6 * radius in height. It holds 49 by 25 points.

Inputs

  • radius (Float, default 0.5, at least 0). The ring's outer radius, in metres; the tube is 0.3 of it, so the ring's centre line runs at 0.7 of it.

Outputs

  • geometry (Geometry). Triangles with P, N and uv on their points; primitives carry vstart and vcount.
local ring = g.mesh.torus({ radius = 1 })