No matching definitions.

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.

afirst SdfExpr handle
bsecond SdfExpr handle

Combined SdfExpr handle.

(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.

afirst SdfExpr handle
bsecond SdfExpr handle

Combined SdfExpr handle.

(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.

abase shape SdfExpr handle
bshape to subtract SdfExpr handle

Combined SdfExpr handle.

(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).

afirst SdfExpr handle
bsecond SdfExpr handle
kblend radius (>= 0)

Combined SdfExpr handle.

(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