Builtin Library
README.md
mesh.capsule
A capsule with its axis along Y, centred on the origin: a cylinder whose two ends are hemispheres, with smooth normals throughout. Use it for pills, limbs and rounded posts.
It is a lattice of 32 segments round and 34 rows from pole to pole; the straight band sits between the two middle rows, and the triangles that close to a point at each pole are dropped. uv runs 0 to 1 round the axis and from pole to pole.
Inputs
radius(Float, default 0.5, at least 0). The radius of its round cross-section and end caps, in metres.height(Float, default 1, at least 0). Its whole length along Y, caps included, in metres. Below twice the radius the capsule is a sphere ofradius.
Outputs
geometry(Geometry). Triangles withP,Nanduvon their points; primitives carryvstartandvcount.
local pill = g.mesh.capsule({ radius = 0.25, height = 1.5 })