sdf.primitives.RevolvedPolygon

sdf.primitives.RevolvedPolygon(vertices, offset=0.0, material=None)

Solid of revolution: a polygon profile revolved around the local Y axis.

Profile coordinates are (radial, height): the profile’s X coordinate is the distance from the revolution axis (plus offset), and its Y coordinate runs along the axis. The profile should stay at non-negative radius (x + offset >= 0) for the distance to remain exact. An edge lying on the axis (x + offset == 0 at both ends, as in a cup’s section) is interior to the solid and is not counted as surface.

Parameters

Name Type Description Default
vertices list[Vector2] Ordered profile vertices — Vector2 parameters (or raw (2,) arrays), in (radial, height) coordinates. required
offset float | Scalar Radial offset added before revolving (Scalar parameter or float). 0.0
material Optional render material. None

Methods

Name Description
patch_fields One field per profile edge, in revolved (radial, height) coords.
sdf Pure SDF: revolve the polygon profile around the local Y axis.

patch_fields

sdf.primitives.RevolvedPolygon.patch_fields()

One field per profile edge, in revolved (radial, height) coords.

Patch k is the surface swept by profile edge (v_k, v_{k+1}): the edge’s outward half-plane distance evaluated at q = (sqrt(x² + z²) - offset, y), exactly as :meth:sdf maps queries into profile coordinates. The profile is closed, so there are no separate cap fields.

sdf

sdf.primitives.RevolvedPolygon.sdf(p, offset, **vertices)

Pure SDF: revolve the polygon profile around the local Y axis.

Parameters

Name Type Description Default
p Array Query point(s), shape (…, 3). required
offset Array Radial offset of the profile. required
**vertices Array v0..v{N-1} profile vertices, each shape (2,). {}

Returns

Name Type Description
Array Signed distance, shape (…).