sdf/transforms
src/sdf/transforms.tur
spatial and morphological modifiers for SdfExpr trees.
Since: Phase 1
defn
sdf-translate
(sdf-translate [e : int tx : float ty : float tz : float] :)
translate an SDF by vector (tx,ty,tz).
Parameters
| e | child SdfExpr handle | |
| tx ty tz -- translation vector |
Returns
Transformed SdfExpr handle.
Example
(sdf-translate (sdf-sphere 0.0 0.0 0.0 1.0) 2.0 0.0 0.0)
Since: Phase 1
defn
sdf-offset
(sdf-offset [e : int d : float] :)
expand (d > 0) or shrink (d < 0) a shape by a constant.
Parameters
| e | child SdfExpr handle | |
| d | offset distance (positive = grow, negative = shrink) |
Returns
Modified SdfExpr handle.
Example
(sdf-offset (sdf-box -0.5 -0.5 -0.5 0.5 0.5 0.5) 0.1) ; rounded box
Since: Phase 1
defn
sdf-shell
(sdf-shell [e : int thickness : float] :)
keep only a `thickness`-wide shell around the surface.
Parameters
| e | child SdfExpr handle | |
| thickness | shell half-thickness (> 0) |
Returns
Modified SdfExpr handle.
Example
(sdf-shell (sdf-sphere 0.0 0.0 0.0 1.0) 0.05)
Since: Phase 1