sdf/expr
SdfExpr tagged-union AST for signed distance fields.
Since: Phase 1
sdf--make-leaf
(sdf--make-leaf [tag :int v0x :float v0y :float v0z :float v1x :float v1y :float v1z :float s0 :float s1 :float] :int)
allocate a leaf SdfExpr (no children).
| tag | SDF_* tag constant | |
| v0x v0y v0z -- first vec3 slot (center / lo corner) | ||
| v1x v1y v1z -- second vec3 slot (direction / hi corner) | ||
| s0 | primary scalar (radius / distance) | |
| s1 | secondary 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
sdf--make-node
(sdf--make-node [tag :int left :int right :int s0 :float s1 :float] :int)
allocate a binary interior SdfExpr node.
| tag | SDF_* tag for this combinator | |
| left | left child handle | |
| right | right child handle | |
| s0 s1 -- optional scalars (blend-k for smooth union, etc.) |
Opaque :int handle to heap-allocated sdf_node.
Since: Phase 1
sdf--make-unary
(sdf--make-unary [tag :int child :int s0 :float s1 :float] :int)
allocate a unary interior SdfExpr node.
| tag | SDF_* tag for this modifier | |
| child | child 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
sdf-tag
(sdf-tag [e :int] :int)
read the tag field of an SdfExpr. Since: Phase 1
sdf-left
(sdf-left [e :int] :int)
left child handle (0 for leaves). Since: Phase 1
sdf-right
(sdf-right [e :int] :int)
right child handle (0 for leaves and unaries). Since: Phase 1
sdf-v0x
(sdf-v0x [e :int] :float)
v0.x component. Since: Phase 1
sdf-v0y
(sdf-v0y [e :int] :float)
v0.y component. Since: Phase 1
sdf-v0z
(sdf-v0z [e :int] :float)
v0.z component. Since: Phase 1
sdf-v1x
(sdf-v1x [e :int] :float)
v1.x component. Since: Phase 1
sdf-v1y
(sdf-v1y [e :int] :float)
v1.y component. Since: Phase 1
sdf-v1z
(sdf-v1z [e :int] :float)
v1.z component. Since: Phase 1
sdf-s0
(sdf-s0 [e :int] :float)
primary scalar (radius, blend-k, offset, etc.). Since: Phase 1
sdf-s1
(sdf-s1 [e :int] :float)
secondary scalar. Since: Phase 1
sdf-free
(sdf-free [e :int] :void)
recursively free an SdfExpr tree.
| e | SdfExpr handle; safe to call with 0 (no-op). |
(sdf-free scene)
Since: Phase 1