No matching definitions.

sdf/primitives

src/sdf/primitives.tur

smart constructors for SDF leaf shapes.

Since: Phase 1

defn

sdf-sphere

(sdf-sphere [cx : float cy : float cz : float r : float] :)

sphere centred at (cx,cy,cz) with radius r.

cx cy cz -- centre position
rradius (> 0)

SdfExpr handle.

(sdf-sphere 0.0 0.0 0.0 1.5)

Since: Phase 1

defn

sdf-box

(sdf-box [lx : float ly : float lz : float hx : float hy : float hz : float] :)

axis-aligned box from corner lo=(lx,ly,lz) to hi=(hx,hy,hz).

lx ly lz -- minimum corner
hx hy hz -- maximum corner

SdfExpr handle.

(sdf-box -1.0 -1.0 -1.0  1.0 1.0 1.0)

Since: Phase 1

defn

sdf-cylinder

(sdf-cylinder [cx : float cy : float cz : float r : float] :)

infinite cylinder along +Z axis, projected radius r.

cx cy cz -- axis centre (z component ignored for distance, used for translate)
rradius (> 0)

SdfExpr handle.

(sdf-cylinder 0.0 0.0 0.0 0.5)

Since: Phase 1

defn

sdf-plane

(sdf-plane [nx : float ny : float nz : float d : float] :)

infinite plane n.p + d = 0.

nx ny nz -- outward normal (unit length recommended)
dplane offset (distance from origin along -n direction)

SdfExpr handle.

(sdf-plane 0.0 1.0 0.0 0.0)   ; floor at y = 0
  (sdf-plane 0.0 1.0 0.0 -2.0)  ; floor at y = 2

Since: Phase 1

defn

sdf-torus

(sdf-torus [cx : float cy : float cz : float big-r : float small-r : float] :)

torus centred at (cx,cy,cz) in the XZ plane.

cx cy cz -- centre position
big-rring radius (distance from centre to tube centre)
small-rtube cross-section radius

SdfExpr handle.

(sdf-torus 0.0 0.0 0.0 1.5 0.3)

Since: Phase 5

defn

sdf-capsule

(sdf-capsule [ax : float ay : float az : float bx : float by : float bz : float r : float] :)

capsule (cylinder with hemispherical caps) from A to B.

ax ay az -- endpoint A
bx by bz -- endpoint B
rcapsule radius

SdfExpr handle.

(sdf-capsule 0.0 -1.0 0.0  0.0 1.0 0.0  0.4)

Since: Phase 5