Documentation / Node reference / code nodes

code/SDFTriPrism

The distance to a triangular prism.

Sdf3d

Returns the signed distance from a sampled position to an equilateral triangular prism: a triangle in the XY plane pointing up, extruded along Z. Its field is a bound rather than an exact distance, under-estimating outside near the edges, which is safe for a raymarch and only costs march steps. For an exact field of the same solid, put a code/SDFEquilateralTriangle2D through an extrusion. The twin of geo/SDFTriPrism, for use inside a geo/SDFBuilder sub-network.

Parameters

Name Type What it does
P Vector3 Position to sample the field at. Left unwired it reads the builder's own sample position.
t Vector3 Prism center.
radius Float Circumradius of the triangle: center to a vertex.
height Float Full depth along Z: the prism spans half of it either side of the center.

See also

This page is generated from the engine, so it describes the release you can download. The same text is in the editor's Help panel next to the node itself.