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] :int)

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] :int)

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] :int)

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] :int)

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