sdf/boolean
src/sdf/boolean.tur
CSG combinators over SdfExpr trees.
Since: Phase 1
defn
sdf-union
(sdf-union [a :int b :int] :int)
CSG union (min) of two SdFs.
Parameters
| a | first SdfExpr handle | |
| b | second SdfExpr handle |
Returns
Combined SdfExpr handle.
Example
(sdf-union (sdf-sphere 0.0 0.0 0.0 1.0)
(sdf-box -2.0 -0.5 -0.5 -1.0 0.5 0.5))
Since: Phase 1
defn
sdf-intersection
(sdf-intersection [a :int b :int] :int)
CSG intersection (max) of two SDFs.
Parameters
| a | first SdfExpr handle | |
| b | second SdfExpr handle |
Returns
Combined SdfExpr handle.
Example
(sdf-intersection (sdf-sphere 0.0 0.0 0.0 1.5)
(sdf-box -1.0 -1.0 -1.0 1.0 1.0 1.0))
Since: Phase 1
defn
sdf-difference
(sdf-difference [a :int b :int] :int)
CSG difference: a minus b.
Parameters
| a | base shape SdfExpr handle | |
| b | shape to subtract SdfExpr handle |
Returns
Combined SdfExpr handle.
Example
(sdf-difference (sdf-sphere 0.0 0.0 0.0 1.5)
(sdf-sphere 0.3 0.0 0.0 1.0))
Since: Phase 1
defn
sdf-smooth-union
(sdf-smooth-union [a :int b :int k :float] :int)
smooth union with blend radius k (Quilez polynomial).
Parameters
| a | first SdfExpr handle | |
| b | second SdfExpr handle | |
| k | blend radius (>= 0) |
Returns
Combined SdfExpr handle.
Example
(sdf-smooth-union (sdf-sphere -0.5 0.0 0.0 0.7)
(sdf-sphere 0.5 0.0 0.0 0.7)
0.4)
Since: Phase 1