No matching definitions.

sdf/expr

src/sdf/expr.tur

SdfExpr tagged-union AST for signed distance fields.

Since: Phase 1

defn

sdf--make-leaf

(sdf--make-leaf [tag : int v0x : float v0y : float v0z : float v1x : float v1y : float v1z : float s0 : float s1 : float] :)

allocate a leaf SdfExpr (no children).

tagSDF_* tag constant
v0x v0y v0z -- first vec3 slot (center / lo corner)
v1x v1y v1z -- second vec3 slot (direction / hi corner)
s0primary scalar (radius / distance)
s1secondary scalar (unused in Phase 1)

Opaque :int handle to heap-allocated sdf_node.

(sdf--make-leaf SDF_SPHERE 0.0 0.0 0.0  0.0 0.0 0.0  1.0 0.0)

Since: Phase 1

defn

sdf--make-node

(sdf--make-node [tag : int left : int right : int s0 : float s1 : float] :)

allocate a binary interior SdfExpr node.

tagSDF_* tag for this combinator
leftleft child handle
rightright child handle
s0 s1 -- optional scalars (blend-k for smooth union, etc.)

Opaque :int handle to heap-allocated sdf_node.

Since: Phase 1

defn

sdf--make-unary

(sdf--make-unary [tag : int child : int s0 : float s1 : float] :)

allocate a unary interior SdfExpr node.

tagSDF_* tag for this modifier
childchild handle (stored in left; right is NULL)
s0 s1 -- optional scalars (offset distance, shell thickness, etc.)

Opaque :int handle to heap-allocated sdf_node.

Since: Phase 1

defn

sdf-tag

(sdf-tag [e : int] :)

read the tag field of an SdfExpr. Since: Phase 1

defn

sdf-left

(sdf-left [e : int] :)

left child handle (0 for leaves). Since: Phase 1

defn

sdf-right

(sdf-right [e : int] :)

right child handle (0 for leaves and unaries). Since: Phase 1

defn

sdf-v0x

(sdf-v0x [e : int] :)

v0.x component. Since: Phase 1

defn

sdf-v0y

(sdf-v0y [e : int] :)

v0.y component. Since: Phase 1

defn

sdf-v0z

(sdf-v0z [e : int] :)

v0.z component. Since: Phase 1

defn

sdf-v1x

(sdf-v1x [e : int] :)

v1.x component. Since: Phase 1

defn

sdf-v1y

(sdf-v1y [e : int] :)

v1.y component. Since: Phase 1

defn

sdf-v1z

(sdf-v1z [e : int] :)

v1.z component. Since: Phase 1

defn

sdf-s0

(sdf-s0 [e : int] :)

primary scalar (radius, blend-k, offset, etc.). Since: Phase 1

defn

sdf-s1

(sdf-s1 [e : int] :)

secondary scalar. Since: Phase 1

defn

sdf--make-unary-full

(sdf--make-unary-full [tag : int child : int v0x : float v0y : float v0z : float v1x : float v1y : float v1z : float s0 : float s1 : float] :)

allocate a unary node with all geometry fields set.

tagSDF_* tag
childchild SdfExpr handle (stored in left)
v0x v0y v0z -- first vec3 slot (period for repeat ops)
v1x v1y v1z -- second vec3 slot (limits for SDF_REPEAT_FIN)
s0 s1 -- optional scalars

Opaque :int handle to heap-allocated sdf_node.

Since: Phase 5

defn

sdf-free

(sdf-free [e : int] :)

recursively free an SdfExpr tree.

eSdfExpr handle; safe to call with 0 (no-op).
(sdf-free scene)

Since: Phase 1