Skip to main content

SdfNode

Enum SdfNode 

Source
#[non_exhaustive]
pub enum SdfNode {
Show 130 variants Sphere { radius: f32, }, Box3d { half_extents: Vec3, }, Cylinder { radius: f32, half_height: f32, }, Torus { major_radius: f32, minor_radius: f32, }, Plane { normal: Vec3, distance: f32, }, Capsule { point_a: Vec3, point_b: Vec3, radius: f32, }, Cone { radius: f32, half_height: f32, }, Ellipsoid { radii: Vec3, }, RoundedCone { r1: f32, r2: f32, half_height: f32, }, Pyramid { half_height: f32, }, Octahedron { size: f32, }, HexPrism { hex_radius: f32, half_height: f32, }, Link { half_length: f32, r1: f32, r2: f32, }, Triangle { point_a: Vec3, point_b: Vec3, point_c: Vec3, }, Bezier { point_a: Vec3, point_b: Vec3, point_c: Vec3, radius: f32, }, RoundedBox { half_extents: Vec3, round_radius: f32, }, CappedCone { half_height: f32, r1: f32, r2: f32, }, CappedTorus { major_radius: f32, minor_radius: f32, cap_angle: f32, }, RoundedCylinder { radius: f32, round_radius: f32, half_height: f32, }, TriangularPrism { width: f32, half_depth: f32, }, CutSphere { radius: f32, cut_height: f32, }, CutHollowSphere { radius: f32, cut_height: f32, thickness: f32, }, DeathStar { ra: f32, rb: f32, d: f32, }, SolidAngle { angle: f32, radius: f32, }, Rhombus { la: f32, lb: f32, half_height: f32, round_radius: f32, }, Horseshoe { angle: f32, radius: f32, half_length: f32, width: f32, thickness: f32, }, Vesica { radius: f32, half_dist: f32, }, InfiniteCylinder { radius: f32, }, InfiniteCone { angle: f32, }, Gyroid { scale: f32, thickness: f32, }, MetricBall { radius: f32, w_l1: f32, w_l2: f32, w_linf: f32, }, MetricBlend { inner: Arc<Self>, outer: Arc<Self>, center: Vec3, radius: f32, skin: f32, }, Heart { size: f32, }, Tube { outer_radius: f32, thickness: f32, half_height: f32, }, Barrel { radius: f32, half_height: f32, bulge: f32, }, Diamond { radius: f32, half_height: f32, }, ChamferedCube { half_extents: Vec3, chamfer: f32, }, SchwarzP { scale: f32, thickness: f32, }, Superellipsoid { half_extents: Vec3, e1: f32, e2: f32, }, RoundedX { width: f32, round_radius: f32, half_height: f32, }, Pie { angle: f32, radius: f32, half_height: f32, }, Trapezoid { r1: f32, r2: f32, trap_height: f32, half_depth: f32, }, Parallelogram { width: f32, para_height: f32, skew: f32, half_depth: f32, }, Tunnel { width: f32, height_2d: f32, half_depth: f32, }, UnevenCapsule { r1: f32, r2: f32, cap_height: f32, half_depth: f32, }, Egg { ra: f32, rb: f32, }, ArcShape { aperture: f32, radius: f32, thickness: f32, half_height: f32, }, Moon { d: f32, ra: f32, rb: f32, half_height: f32, }, CrossShape { length: f32, thickness: f32, round_radius: f32, half_height: f32, }, BlobbyCross { size: f32, half_height: f32, }, ParabolaSegment { width: f32, para_height: f32, half_depth: f32, }, RegularPolygon { radius: f32, n_sides: f32, half_height: f32, }, StarPolygon { radius: f32, n_points: f32, m: f32, half_height: f32, }, Stairs { step_width: f32, step_height: f32, n_steps: f32, half_depth: f32, }, Helix { major_r: f32, minor_r: f32, pitch: f32, half_height: f32, }, Tetrahedron { size: f32, }, Dodecahedron { radius: f32, }, Icosahedron { radius: f32, }, TruncatedOctahedron { radius: f32, }, TruncatedIcosahedron { radius: f32, }, BoxFrame { half_extents: Vec3, edge: f32, }, DiamondSurface { scale: f32, thickness: f32, }, Neovius { scale: f32, thickness: f32, }, Lidinoid { scale: f32, thickness: f32, }, IWP { scale: f32, thickness: f32, }, FRD { scale: f32, thickness: f32, }, FischerKochS { scale: f32, thickness: f32, }, PMY { scale: f32, thickness: f32, }, Circle2D { radius: f32, half_height: f32, }, Rect2D { half_extents: Vec2, half_height: f32, }, Segment2D { a: Vec2, b: Vec2, thickness: f32, half_height: f32, }, Polygon2D { vertices: Vec<Vec2>, half_height: f32, }, RoundedRect2D { half_extents: Vec2, round_radius: f32, half_height: f32, }, Annular2D { outer_radius: f32, thickness: f32, half_height: f32, }, Union { a: Arc<Self>, b: Arc<Self>, }, Intersection { a: Arc<Self>, b: Arc<Self>, }, Subtraction { a: Arc<Self>, b: Arc<Self>, }, SmoothUnion { a: Arc<Self>, b: Arc<Self>, k: f32, }, SmoothIntersection { a: Arc<Self>, b: Arc<Self>, k: f32, }, SmoothSubtraction { a: Arc<Self>, b: Arc<Self>, k: f32, }, ChamferUnion { a: Arc<Self>, b: Arc<Self>, r: f32, }, ChamferIntersection { a: Arc<Self>, b: Arc<Self>, r: f32, }, ChamferSubtraction { a: Arc<Self>, b: Arc<Self>, r: f32, }, StairsUnion { a: Arc<Self>, b: Arc<Self>, r: f32, n: f32, }, StairsIntersection { a: Arc<Self>, b: Arc<Self>, r: f32, n: f32, }, StairsSubtraction { a: Arc<Self>, b: Arc<Self>, r: f32, n: f32, }, XOR { a: Arc<Self>, b: Arc<Self>, }, Morph { a: Arc<Self>, b: Arc<Self>, t: f32, }, ColumnsUnion { a: Arc<Self>, b: Arc<Self>, r: f32, n: f32, }, ColumnsIntersection { a: Arc<Self>, b: Arc<Self>, r: f32, n: f32, }, ColumnsSubtraction { a: Arc<Self>, b: Arc<Self>, r: f32, n: f32, }, Pipe { a: Arc<Self>, b: Arc<Self>, r: f32, }, Engrave { a: Arc<Self>, b: Arc<Self>, r: f32, }, Groove { a: Arc<Self>, b: Arc<Self>, ra: f32, rb: f32, }, Tongue { a: Arc<Self>, b: Arc<Self>, ra: f32, rb: f32, }, ExpSmoothUnion { a: Arc<Self>, b: Arc<Self>, k: f32, }, ExpSmoothIntersection { a: Arc<Self>, b: Arc<Self>, k: f32, }, ExpSmoothSubtraction { a: Arc<Self>, b: Arc<Self>, k: f32, }, Translate { child: Arc<Self>, offset: Vec3, }, Rotate { child: Arc<Self>, rotation: Quat, }, Scale { child: Arc<Self>, factor: f32, }, ScaleNonUniform { child: Arc<Self>, factors: Vec3, }, ProjectiveTransform { child: Arc<Self>, inv_matrix: [f32; 16], lipschitz_bound: f32, }, LatticeDeform { child: Arc<Self>, control_points: Vec<Vec3>, nx: u32, ny: u32, nz: u32, bbox_min: Vec3, bbox_max: Vec3, }, SdfSkinning { child: Arc<Self>, bones: Vec<BoneTransform>, }, Twist { child: Arc<Self>, strength: f32, }, Bend { child: Arc<Self>, curvature: f32, }, RepeatInfinite { child: Arc<Self>, spacing: Vec3, }, RepeatFinite { child: Arc<Self>, count: [u32; 3], spacing: Vec3, }, Noise { child: Arc<Self>, amplitude: f32, frequency: f32, seed: u32, }, Round { child: Arc<Self>, radius: f32, }, Onion { child: Arc<Self>, thickness: f32, }, Elongate { child: Arc<Self>, amount: Vec3, }, Mirror { child: Arc<Self>, axes: Vec3, }, Revolution { child: Arc<Self>, offset: f32, }, Extrude { child: Arc<Self>, half_height: f32, }, SweepBezier { child: Arc<Self>, p0: Vec2, p1: Vec2, p2: Vec2, }, Taper { child: Arc<Self>, factor: f32, reach: [f32; 2], }, Displacement { child: Arc<Self>, strength: f32, }, SineDisplacement { child: Arc<Self>, amplitude: f32, frequency: Vec3, }, PolarRepeat { child: Arc<Self>, count: u32, }, OctantMirror { child: Arc<Self>, }, Shear { child: Arc<Self>, shear: Vec3, }, Animated { child: Arc<Self>, speed: f32, amplitude: f32, }, WithMaterial { child: Arc<Self>, material_id: u32, }, IcosahedralSymmetry { child: Arc<Self>, }, IFS { child: Arc<Self>, transforms: Vec<[f32; 16]>, iterations: u32, }, HeightmapDisplacement { child: Arc<Self>, heightmap: Vec<f32>, width: u32, height: u32, amplitude: f32, scale: f32, }, SurfaceRoughness { child: Arc<Self>, frequency: f32, amplitude: f32, octaves: u32, }, Terrain { scale: f32, amplitude: f32, },
}
Expand description

Signed Distance Function Node

Represents a node in the SDF tree. Each node can be:

  • A primitive shape (sphere, box, etc.)
  • An operation combining two shapes (union, intersection, etc.)
  • A transform applied to a child node
  • A modifier deforming a child node

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Sphere

Sphere with radius

Fields

§radius: f32

Sphere radius

§

Box3d

Axis-aligned box with half-extents

Fields

§half_extents: Vec3

Half-extents along each axis

§

Cylinder

Cylinder along Y-axis with radius and half-height

Fields

§radius: f32

Cylinder radius

§half_height: f32

Half the cylinder height

§

Torus

Torus in XZ plane with major and minor radius

Fields

§major_radius: f32

Distance from center to tube center

§minor_radius: f32

Tube radius

§

Plane

Infinite plane with normal and distance from origin

Fields

§normal: Vec3

Plane normal direction

§distance: f32

Signed distance from origin along normal

§

Capsule

Capsule between two points with radius

Fields

§point_a: Vec3

First endpoint

§point_b: Vec3

Second endpoint

§radius: f32

Capsule radius

§

Cone

Cone along Y-axis with base radius and half-height

Fields

§radius: f32

Base radius

§half_height: f32

Half the cone height

§

Ellipsoid

Ellipsoid with semi-axis radii

Fields

§radii: Vec3

Semi-axis radii (x, y, z)

§

RoundedCone

Rounded cone along Y-axis with bottom radius r1, top radius r2

Fields

§r1: f32

Bottom sphere radius

§r2: f32

Top sphere radius

§half_height: f32

Half the cone height

§

Pyramid

4-sided pyramid with square base (side=1) centered at origin

Fields

§half_height: f32

Half the pyramid height

§

Octahedron

Regular octahedron centered at origin

Fields

§size: f32

Distance from center to vertex

§

HexPrism

Hexagonal prism centered at origin

Fields

§hex_radius: f32

Hexagon circumradius

§half_height: f32

Half the prism height

Chain link shape centered at origin

Fields

§half_length: f32

Half the straight section length

§r1: f32

Major radius (center to tube center)

§r2: f32

Minor radius (tube thickness)

§

Triangle

Triangle defined by three vertices (unsigned distance)

Fields

§point_a: Vec3

First vertex

§point_b: Vec3

Second vertex

§point_c: Vec3

Third vertex

§

Bezier

Quadratic Bezier curve with radius (tube around curve)

Fields

§point_a: Vec3

Start point

§point_b: Vec3

Control point

§point_c: Vec3

End point

§radius: f32

Tube radius

§

RoundedBox

Box with rounded edges

Fields

§half_extents: Vec3

Half-extents (before rounding)

§round_radius: f32

Edge rounding radius

§

CappedCone

Capped cone (frustum) along Y-axis

Fields

§half_height: f32

Half the cone height

§r1: f32

Bottom radius

§r2: f32

Top radius

§

CappedTorus

Partial torus (arc) in XZ plane

Fields

§major_radius: f32

Distance from center to tube center

§minor_radius: f32

Tube radius

§cap_angle: f32

Half opening angle (radians)

§

RoundedCylinder

Cylinder with rounded edges along Y-axis

Fields

§radius: f32

Cylinder radius

§round_radius: f32

Edge rounding radius

§half_height: f32

Half the cylinder height

§

TriangularPrism

Equilateral triangular prism along Z-axis

Fields

§width: f32

Half-width of the triangle cross-section

§half_depth: f32

Half the prism depth along Z

§

CutSphere

Sphere with a planar cut

Fields

§radius: f32

Sphere radius

§cut_height: f32

Y height of the cut plane

§

CutHollowSphere

Hollow sphere shell with a planar cut

Fields

§radius: f32

Sphere radius

§cut_height: f32

Y height of the cut plane

§thickness: f32

Shell thickness

§

DeathStar

Death Star: sphere with spherical indentation

Fields

§ra: f32

Main sphere radius

§rb: f32

Carving sphere radius

§d: f32

Distance between sphere centers

§

SolidAngle

Solid angle (cone sector)

Fields

§angle: f32

Half-angle in radians

§radius: f32

Bounding radius

§

Rhombus

3D rhombus (diamond shape)

Fields

§la: f32

Half-diagonal along X

§lb: f32

Half-diagonal along Z

§half_height: f32

Half-height along Y

§round_radius: f32

Edge rounding

§

Horseshoe

Horseshoe (U-shape)

Fields

§angle: f32

Opening half-angle (radians)

§radius: f32

Ring radius

§half_length: f32

Straight extension half-length

§width: f32

Cross-section half-width

§thickness: f32

Cross-section half-thickness

§

Vesica

3D vesica (lens shape, revolved)

Fields

§radius: f32

Arc radius

§half_dist: f32

Half distance between arc centers

§

InfiniteCylinder

Infinite cylinder along Y-axis

Fields

§radius: f32

Cylinder radius

§

InfiniteCone

Infinite cone along Y-axis

Fields

§angle: f32

Half-angle in radians

§

Gyroid

Gyroid triply-periodic minimal surface

Fields

§scale: f32

Spatial frequency

§thickness: f32

Shell half-thickness

§

MetricBall

Ball of a weighted norm — w₁‖p‖₁ + w₂‖p‖₂ + w∞‖p‖∞ − radius.

The three weights choose the shape: (0, 1, 0) is a sphere, (0, 0, 1) a cube, (1, 0, 0) an octahedron, and anything in between a convex blend of those unit balls. They are non-negative and not all zero — SdfNode::metric_ball takes a validated MetricWeights, which is the only way to build one.

Fields

§radius: f32

Radius in the ball’s own metric.

§w_l1: f32

Weight of ‖·‖₁ (octahedral).

§w_l2: f32

Weight of ‖·‖₂ (Euclidean).

§w_linf: f32

Weight of ‖·‖∞ (cubic).

§

MetricBlend

Two fields blended over a spherical skin — the inner field inside a bubble, the outer one beyond it, smoothly joined across the skin.

Inside radius the result is the inner field exactly, beyond radius + skin the outer one exactly (the blend weight is exactly 0 and 1 there, and the interpolation is endpoint-exact), so placing a bubble never perturbs the world outside it.

The blend of two unrelated fields is not a distance function: across the skin the gradient picks up |f_in − f_out| · |∇w|, which no static bound can know, so eval_lipschitz reports infinity for it. Use measure_tension over the skin to find out what it actually does.

Fields

§inner: Arc<Self>

Field inside the bubble.

§outer: Arc<Self>

Field outside it.

§center: Vec3

Bubble centre.

§radius: f32

Radius at which the skin starts.

§skin: f32

Skin width; the blend spans [radius, radius + skin].

§

Heart

3D heart shape (revolved contour)

Fields

§size: f32

Overall size

§

Tube

Hollow cylinder (tube/pipe) along Y-axis

Fields

§outer_radius: f32

Radius of the tube center-line

§thickness: f32

Half-wall thickness

§half_height: f32

Half the tube height

§

Barrel

Cylinder with parabolic radial bulge along Y-axis

Fields

§radius: f32

Base radius at caps

§half_height: f32

Half the barrel height

§bulge: f32

Additional radius at the middle

§

Diamond

Bipyramid (double-cone) with revolution symmetry

Fields

§radius: f32

Equator radius

§half_height: f32

Half the total height

§

ChamferedCube

Box with chamfered (beveled) edges

Fields

§half_extents: Vec3

Half-extents along each axis

§chamfer: f32

Chamfer amount

§

SchwarzP

Schwarz P triply-periodic minimal surface

Fields

§scale: f32

Spatial frequency

§thickness: f32

Shell half-thickness

§

Superellipsoid

Generalized ellipsoid (sphere-box morph)

Fields

§half_extents: Vec3

Semi-axis radii

§e1: f32

North-south roundness

§e2: f32

East-west roundness

§

RoundedX

Rounded X shape extruded along Y-axis

Fields

§width: f32

Arm length

§round_radius: f32

Rounding radius

§half_height: f32

Half the extrusion height

§

Pie

Pie (sector) shape extruded along Y-axis

Fields

§angle: f32

Half opening angle in radians

§radius: f32

Pie radius

§half_height: f32

Half the extrusion height

§

Trapezoid

Trapezoid prism in XY plane, extruded along Z

Fields

§r1: f32

Half-width at bottom

§r2: f32

Half-width at top

§trap_height: f32

Half-height of the 2D trapezoid

§half_depth: f32

Half the extrusion depth along Z

§

Parallelogram

Parallelogram prism in XY plane, extruded along Z

Fields

§width: f32

Half-width

§para_height: f32

Half-height

§skew: f32

Horizontal skew

§half_depth: f32

Half the extrusion depth along Z

§

Tunnel

Tunnel (arch opening) in XY plane, extruded along Z

Fields

§width: f32

Half-width of the tunnel

§height_2d: f32

Height of the 2D tunnel opening

§half_depth: f32

Half the extrusion depth along Z

§

UnevenCapsule

Uneven capsule prism in XY plane, extruded along Z

Fields

§r1: f32

Bottom circle radius

§r2: f32

Top circle radius

§cap_height: f32

Half-height between circle centers

§half_depth: f32

Half the extrusion depth along Z

§

Egg

Egg shape (revolution body) around Y-axis

Fields

§ra: f32

Overall size / base radius

§rb: f32

Top deformation (controls pointiness)

§

ArcShape

Arc shape (thick ring sector) in XZ plane, extruded along Y

Fields

§aperture: f32

Half opening angle in radians

§radius: f32

Arc center radius

§thickness: f32

Ring half-thickness

§half_height: f32

Half the extrusion height along Y

§

Moon

Moon (crescent) shape in XZ plane, extruded along Y

Fields

§d: f32

Distance between circle centers

§ra: f32

Outer circle radius

§rb: f32

Inner (subtracted) circle radius

§half_height: f32

Half the extrusion height along Y

§

CrossShape

Cross (plus) shape in XZ plane, extruded along Y

Fields

§length: f32

Half-length of cross arms

§thickness: f32

Half-thickness of cross arms

§round_radius: f32

Rounding radius

§half_height: f32

Half the extrusion height along Y

§

BlobbyCross

Blobby cross (organic) in XZ plane, extruded along Y

Fields

§size: f32

Overall size

§half_height: f32

Half the extrusion height along Y

§

ParabolaSegment

Parabola segment in XY plane, extruded along Z

Fields

§width: f32

Half-width of the parabola base

§para_height: f32

Height of the parabola

§half_depth: f32

Half the extrusion depth along Z

§

RegularPolygon

Regular N-sided polygon prism in XZ plane, extruded along Y

Fields

§radius: f32

Circumscribed circle radius (center to vertex)

§n_sides: f32

Number of sides (as f32)

§half_height: f32

Half the extrusion height along Y

§

StarPolygon

Star polygon prism in XZ plane, extruded along Y

Fields

§radius: f32

Outer vertex radius

§n_points: f32

Number of star points (as f32)

§m: f32

Inner vertex radius (spike depth)

§half_height: f32

Half the extrusion height along Y

§

Stairs

Staircase shape in XY plane, extruded along Z

Fields

§step_width: f32

Width of each step

§step_height: f32

Height of each step

§n_steps: f32

Number of steps (as f32)

§half_depth: f32

Half the extrusion depth along Z

§

Helix

Helix (spiral tube) along Y-axis

Fields

§major_r: f32

Major radius (distance from Y-axis to helix center)

§minor_r: f32

Minor radius (tube thickness)

§pitch: f32

Vertical distance per full revolution

§half_height: f32

Half the height along Y

§

Tetrahedron

Regular tetrahedron centered at origin

Fields

§size: f32

Distance from center to face

§

Dodecahedron

Regular dodecahedron centered at origin (GDF)

Fields

§radius: f32

Distance from center to face

§

Icosahedron

Regular icosahedron centered at origin (GDF)

Fields

§radius: f32

Distance from center to face

§

TruncatedOctahedron

Truncated octahedron centered at origin (GDF)

Fields

§radius: f32

Distance from center to face

§

TruncatedIcosahedron

Truncated icosahedron (soccer ball) centered at origin (GDF)

Fields

§radius: f32

Distance from center to face

§

BoxFrame

Box frame (wireframe box, edges only)

Fields

§half_extents: Vec3

Half-extents along each axis

§edge: f32

Edge thickness

§

DiamondSurface

Diamond surface (Schwarz D TPMS)

Fields

§scale: f32

Spatial frequency

§thickness: f32

Shell half-thickness

§

Neovius

Neovius surface (TPMS)

Fields

§scale: f32

Spatial frequency

§thickness: f32

Shell half-thickness

§

Lidinoid

Lidinoid surface (TPMS)

Fields

§scale: f32

Spatial frequency

§thickness: f32

Shell half-thickness

§

IWP

IWP surface (TPMS)

Fields

§scale: f32

Spatial frequency

§thickness: f32

Shell half-thickness

§

FRD

FRD surface (TPMS)

Fields

§scale: f32

Spatial frequency

§thickness: f32

Shell half-thickness

§

FischerKochS

Fischer-Koch S surface (TPMS)

Fields

§scale: f32

Spatial frequency

§thickness: f32

Shell half-thickness

§

PMY

PMY surface (TPMS)

Fields

§scale: f32

Spatial frequency

§thickness: f32

Shell half-thickness

§

Circle2D

2D Circle extruded along Z

Fields

§radius: f32

Circle radius

§half_height: f32

Half-height of extrusion along Z

§

Rect2D

2D Rectangle extruded along Z

Fields

§half_extents: Vec2

Half-width and half-height of the rectangle

§half_height: f32

Half-depth of extrusion along Z

§

Segment2D

2D Line Segment extruded along Z

Fields

§a: Vec2

Start point

§b: Vec2

End point

§thickness: f32

Segment thickness (radius)

§half_height: f32

Half-depth of extrusion along Z

§

Polygon2D

2D Polygon (convex, up to 8 vertices) extruded along Z

Fields

§vertices: Vec<Vec2>

Vertices (up to 8)

§half_height: f32

Half-depth of extrusion along Z

§

RoundedRect2D

2D Rounded Rectangle extruded along Z

Fields

§half_extents: Vec2

Half-extents of the rectangle

§round_radius: f32

Corner rounding radius

§half_height: f32

Half-depth of extrusion along Z

§

Annular2D

2D Annular (ring) shape extruded along Z

Fields

§outer_radius: f32

Outer radius

§thickness: f32

Ring thickness

§half_height: f32

Half-depth of extrusion along Z

§

Union

Union of two shapes (min distance)

Fields

§a: Arc<Self>

First operand

§b: Arc<Self>

Second operand

§

Intersection

Intersection of two shapes (max distance)

Fields

§a: Arc<Self>

First operand

§b: Arc<Self>

Second operand

§

Subtraction

Subtraction: a minus b (max of a and -b)

Fields

§a: Arc<Self>

Shape to subtract from

§b: Arc<Self>

Shape to subtract

§

SmoothUnion

Smooth union with blending factor k

Fields

§a: Arc<Self>

First operand

§b: Arc<Self>

Second operand

§k: f32

Blending radius

§

SmoothIntersection

Smooth intersection with blending factor k

Fields

§a: Arc<Self>

First operand

§b: Arc<Self>

Second operand

§k: f32

Blending radius

§

SmoothSubtraction

Smooth subtraction with blending factor k

Fields

§a: Arc<Self>

Shape to subtract from

§b: Arc<Self>

Shape to subtract

§k: f32

Blending radius

§

ChamferUnion

Chamfer union: 45-degree beveled blend

Fields

§a: Arc<Self>

First operand

§b: Arc<Self>

Second operand

§r: f32

Chamfer radius

§

ChamferIntersection

Chamfer intersection: 45-degree beveled blend

Fields

§a: Arc<Self>

First operand

§b: Arc<Self>

Second operand

§r: f32

Chamfer radius

§

ChamferSubtraction

Chamfer subtraction: 45-degree beveled blend

Fields

§a: Arc<Self>

Shape to subtract from

§b: Arc<Self>

Shape to subtract

§r: f32

Chamfer radius

§

StairsUnion

Stairs union: stepped/terraced blend (Mercury hg_sdf)

Fields

§a: Arc<Self>

First operand

§b: Arc<Self>

Second operand

§r: f32

Blend radius

§n: f32

Number of steps (n-1 visible steps)

§

StairsIntersection

Stairs intersection: stepped/terraced blend

Fields

§a: Arc<Self>

First operand

§b: Arc<Self>

Second operand

§r: f32

Blend radius

§n: f32

Number of steps

§

StairsSubtraction

Stairs subtraction: stepped/terraced blend

Fields

§a: Arc<Self>

Shape to subtract from

§b: Arc<Self>

Shape to subtract

§r: f32

Blend radius

§n: f32

Number of steps

§

XOR

XOR (symmetric difference)

Fields

§a: Arc<Self>

Left operand

§b: Arc<Self>

Right operand

§

Morph

Morph (linear interpolation between two shapes)

Fields

§a: Arc<Self>

Source shape

§b: Arc<Self>

Target shape

§t: f32

Blend factor (0=a, 1=b)

§

ColumnsUnion

Columns union: column-shaped blend

Fields

§a: Arc<Self>

Left operand

§b: Arc<Self>

Right operand

§r: f32

Column radius

§n: f32

Number of columns

§

ColumnsIntersection

Columns intersection: column-shaped blend

Fields

§a: Arc<Self>

Left operand

§b: Arc<Self>

Right operand

§r: f32

Column radius

§n: f32

Number of columns

§

ColumnsSubtraction

Columns subtraction: column-shaped blend

Fields

§a: Arc<Self>

Left operand

§b: Arc<Self>

Right operand

§r: f32

Column radius

§n: f32

Number of columns

§

Pipe

Pipe: cylindrical surface at intersection

Fields

§a: Arc<Self>

Left operand

§b: Arc<Self>

Right operand

§r: f32

Pipe radius

§

Engrave

Engrave: engrave shape b into shape a

Fields

§a: Arc<Self>

Base shape (receives the engraving)

§b: Arc<Self>

Engraving shape

§r: f32

Engrave depth

§

Groove

Groove: cut a groove of shape b into shape a

Fields

§a: Arc<Self>

Base shape (receives the groove)

§b: Arc<Self>

Groove profile shape

§ra: f32

Groove width

§rb: f32

Groove depth

§

Tongue

Tongue: add a tongue protrusion

Fields

§a: Arc<Self>

Base shape

§b: Arc<Self>

Tongue profile shape

§ra: f32

Tongue width

§rb: f32

Tongue height

§

ExpSmoothUnion

Exponential smooth union (IQ): exp-weighted smooth min

Fields

§a: Arc<Self>

Left operand

§b: Arc<Self>

Right operand

§k: f32

Smoothness parameter

§

ExpSmoothIntersection

Exponential smooth intersection

Fields

§a: Arc<Self>

Left operand

§b: Arc<Self>

Right operand

§k: f32

Smoothness parameter

§

ExpSmoothSubtraction

Exponential smooth subtraction

Fields

§a: Arc<Self>

Left operand

§b: Arc<Self>

Right operand

§k: f32

Smoothness parameter

§

Translate

Translation

Fields

§child: Arc<Self>

Child node

§offset: Vec3

Translation offset

§

Rotate

Rotation (quaternion)

Fields

§child: Arc<Self>

Child node

§rotation: Quat

Rotation quaternion

§

Scale

Uniform scale

Fields

§child: Arc<Self>

Child node

§factor: f32

Scale factor

§

ScaleNonUniform

Non-uniform scale (stretches the shape)

Fields

§child: Arc<Self>

Child node

§factors: Vec3

Scale factors per axis

§

ProjectiveTransform

Projective (perspective) transform with Lipschitz correction

Fields

§child: Arc<Self>

Child node

§inv_matrix: [f32; 16]

Inverse projection matrix (column-major)

§lipschitz_bound: f32

Lipschitz bound for distance correction

§

LatticeDeform

Free-Form Deformation via control point lattice

Fields

§child: Arc<Self>

Child node

§control_points: Vec<Vec3>

Control points array

§nx: u32

Number of control points along X

§ny: u32

Number of control points along Y

§nz: u32

Number of control points along Z

§bbox_min: Vec3

Lattice bounding box minimum

§bbox_max: Vec3

Lattice bounding box maximum

§

SdfSkinning

SDF Skinning — bone-weight based spatial blending

Fields

§child: Arc<Self>

Child node

§bones: Vec<BoneTransform>

Bone transforms with weights

§

Twist

Twist around Y-axis (radians per unit height)

Fields

§child: Arc<Self>

Child node

§strength: f32

Twist strength (radians per unit)

§

Bend

Bend around Y-axis

Fields

§child: Arc<Self>

Child node

§curvature: f32

Bend curvature

§

RepeatInfinite

Infinite repetition with spacing

Fields

§child: Arc<Self>

Child node

§spacing: Vec3

Spacing between repetitions

§

RepeatFinite

Finite repetition with count and spacing

Fields

§child: Arc<Self>

Child node

§count: [u32; 3]

Repeat count per axis

§spacing: Vec3

Spacing between repetitions

§

Noise

Perlin noise displacement

Fields

§child: Arc<Self>

Child node

§amplitude: f32

Noise amplitude

§frequency: f32

Noise frequency

§seed: u32

Random seed

§

Round

Round edges by subtracting radius

Fields

§child: Arc<Self>

Child node

§radius: f32

Rounding radius

§

Onion

Onion: creates a shell with thickness

Fields

§child: Arc<Self>

Child node

§thickness: f32

Shell thickness

§

Elongate

Elongate along an axis

Fields

§child: Arc<Self>

Child node

§amount: Vec3

Elongation amount per axis

§

Mirror

Mirror along specified axes (takes absolute value of coordinates)

Fields

§child: Arc<Self>

Child node

§axes: Vec3

Mirror axes (nonzero = mirrored)

§

Revolution

Revolution around Y-axis (creates rotational symmetry)

Fields

§child: Arc<Self>

Child node

§offset: f32

Radial offset

§

Extrude

Extrude along Z-axis (creates 3D from XY cross-section)

Fields

§child: Arc<Self>

Child node

§half_height: f32

Half the extrusion height

§

SweepBezier

Sweep along a quadratic Bezier curve in the XZ plane. The child SDF is evaluated at (perpendicular_distance, y, 0). Creates tubes, channels, or any cross-section shape along a curved path.

Fields

§child: Arc<Self>

Child node (2D cross-section, evaluated in XY)

§p0: Vec2

Bezier start point (XZ plane)

§p1: Vec2

Bezier control point (XZ plane)

§p2: Vec2

Bezier end point (XZ plane)

§

Taper

Taper: the child is evaluated at (x, y, z) / (1 − y·factor) (a perspective map with centre (0, 1/factor, 0)), and its distance is turned into a parent-space bound by real::taper_bound.

Fields

§child: Arc<Self>

Child node

§factor: f32

Taper factor

§reach: [f32; 2]

Reach of the child in its own space, [r_xz, r_y] (|q_xz| ≤ r_xz, |q_y| ≤ r_y), computed by SdfNode::taper from the child’s AABB. It bounds the parent-space shape by a cone ∩ slab so that the singular plane y = 1/factor is not reported as a surface. [INFINITY; 2] (unbounded child, or a file written before 2.0) keeps only the Jacobian bound. Must be recomputed (SdfNode::taper) if the child changes.

§

Displacement

Sin-based displacement (post-processing modifier)

Fields

§child: Arc<Self>

Child node

§strength: f32

Displacement strength

§

SineDisplacement

Sin-based displacement with custom amplitude and per-axis frequency (= Vec3 frequency for anisotropic patterns、 e.g. elongated diamond scales)

Fields

§child: Arc<Self>

Child node

§amplitude: f32

Displacement amplitude (= strength magnitude)

§frequency: Vec3

Sin wave frequency per axis (= use Vec3::splat(f) for isotropic)

§

PolarRepeat

Polar repetition around Y-axis

Fields

§child: Arc<Self>

Child node

§count: u32

Number of copies around Y-axis

§

OctantMirror

Octant mirror: maps point to first octant with x >= y >= z (48-fold symmetry)

Fields

§child: Arc<Self>

Child node

§

Shear

Shear deformation (modifies evaluation point)

Fields

§child: Arc<Self>

Child node

§shear: Vec3

Shear factors: (xy, xz, yz)

§

Animated

Animated modifier: applies time-based transformation

Fields

§child: Arc<Self>

Child node

§speed: f32

Animation speed multiplier

§amplitude: f32

Animation amplitude

§

WithMaterial

Assign a material ID to a subtree (transparent for distance evaluation)

Fields

§child: Arc<Self>

Child node

§material_id: u32

Material ID (indexes into MaterialLibrary)

§

IcosahedralSymmetry

Icosahedral symmetry (120-fold) — maps to fundamental domain

Fields

§child: Arc<Self>

Child node

§

IFS

Iterated Function System — fractal self-similar folding

Fields

§child: Arc<Self>

Child node

§transforms: Vec<[f32; 16]>

Affine transforms (column-major Mat4)

§iterations: u32

Number of iterations

§

HeightmapDisplacement

Heightmap displacement — image-based surface perturbation

Fields

§child: Arc<Self>

Child node

§heightmap: Vec<f32>

Heightmap data (row-major, grayscale)

§width: u32

Heightmap width

§height: u32

Heightmap height

§amplitude: f32

Displacement amplitude

§scale: f32

UV scale

§

SurfaceRoughness

Surface roughness — FBM micro-detail noise

Fields

§child: Arc<Self>

Child node

§frequency: f32

Noise frequency

§amplitude: f32

Noise amplitude

§octaves: u32

Number of octaves

§

Terrain

Biome terrain — procedural terrain with FBM + Voronoi erosion Uses radial biome blending (snow, desert, rock, grassland)

Fields

§scale: f32

Overall terrain scale (higher = larger terrain features)

§amplitude: f32

Vertical amplitude multiplier

Implementations§

Source§

impl SdfNode

Source

pub const fn sphere(radius: f32) -> Self

Create a sphere with the given radius

Source

pub fn box3d(width: f32, height: f32, depth: f32) -> Self

Create an axis-aligned box with the given full dimensions (width × height × depth; the node stores half of each).

§Naming hazard

This is the one box constructor that takes full extents. Both SdfNode::rounded_box and the LOL DSL box3d(hx, hy, hz) take half-extents — box3d(20, 20, 3) in LOL is a 40 × 40 × 6 mm box, while SdfNode::box3d(20.0, 20.0, 3.0) in Rust is 20 × 20 × 3 mm. Use SdfNode::box3d_half_extents when you hold half-extents (for example when porting a LOL expression to Rust) so the intent is visible at the call site. Neither spelling can change without breaking published callers, so the difference is documented rather than unified.

Source

pub const fn box3d_half_extents(hx: f32, hy: f32, hz: f32) -> Self

Create an axis-aligned box from half-extents — the same convention as SdfNode::rounded_box and the LOL DSL box3d.

use alice_sdf::types::SdfNode;
// LOL `box3d(20, 10, 1.5)` (40 × 20 × 3 mm) ported to Rust:
let a = SdfNode::box3d_half_extents(20.0, 10.0, 1.5);
let b = SdfNode::box3d(40.0, 20.0, 3.0);
let p = glam::Vec3::new(19.0, 9.0, 1.0);
assert_eq!(alice_sdf::eval::eval(&a, p), alice_sdf::eval::eval(&b, p));
Source

pub fn cylinder(radius: f32, height: f32) -> Self

Create a cylinder along Y-axis

Source

pub const fn torus(major_radius: f32, minor_radius: f32) -> Self

Create a torus in the XZ plane

Source

pub fn plane(normal: Vec3, distance: f32) -> Self

Create an infinite plane

Source

pub const fn capsule(a: Vec3, b: Vec3, radius: f32) -> Self

Create a capsule between two points

Source

pub fn cone(radius: f32, height: f32) -> Self

Create a cone along Y-axis

Source

pub const fn ellipsoid(rx: f32, ry: f32, rz: f32) -> Self

Create an ellipsoid with given semi-axis radii

Source

pub fn rounded_cone(r1: f32, r2: f32, height: f32) -> Self

Create a rounded cone along Y-axis

Source

pub fn pyramid(height: f32) -> Self

Create a 4-sided pyramid

Source

pub const fn octahedron(size: f32) -> Self

Create a regular octahedron

Source

pub fn hex_prism(hex_radius: f32, height: f32) -> Self

Create a hexagonal prism

Create a chain link shape

Source

pub const fn triangle(a: Vec3, b: Vec3, c: Vec3) -> Self

Create a triangle from three vertices

Source

pub const fn bezier(a: Vec3, b: Vec3, c: Vec3, radius: f32) -> Self

Create a quadratic Bezier curve tube

Source

pub const fn rounded_box(hx: f32, hy: f32, hz: f32, round_radius: f32) -> Self

Create a rounded box from half-extents (hx, hy, hz) and an edge rounding radius.

Note the asymmetry with SdfNode::box3d, which takes full dimensions; see SdfNode::box3d_half_extents for the half-extent spelling of the plain box.

Source

pub fn capped_cone(height: f32, r1: f32, r2: f32) -> Self

Create a capped cone (frustum)

Source

pub const fn capped_torus( major_radius: f32, minor_radius: f32, cap_angle: f32, ) -> Self

Create a capped torus (arc)

Source

pub fn rounded_cylinder(radius: f32, round_radius: f32, height: f32) -> Self

Create a rounded cylinder

Source

pub fn triangular_prism(width: f32, depth: f32) -> Self

Create a triangular prism

Source

pub const fn cut_sphere(radius: f32, cut_height: f32) -> Self

Create a cut sphere

Source

pub const fn cut_hollow_sphere( radius: f32, cut_height: f32, thickness: f32, ) -> Self

Create a cut hollow sphere

Source

pub const fn death_star(ra: f32, rb: f32, d: f32) -> Self

Create a Death Star shape

Source

pub const fn solid_angle(angle: f32, radius: f32) -> Self

Create a solid angle

Source

pub fn rhombus(la: f32, lb: f32, height: f32, round_radius: f32) -> Self

Create a rhombus

Source

pub fn horseshoe( angle: f32, radius: f32, length: f32, width: f32, thickness: f32, ) -> Self

Create a horseshoe shape

Source

pub fn vesica(radius: f32, dist: f32) -> Self

Create a 3D vesica

Source

pub const fn infinite_cylinder(radius: f32) -> Self

Create an infinite cylinder

Source

pub const fn infinite_cone(angle: f32) -> Self

Create an infinite cone

Source

pub const fn gyroid(scale: f32, thickness: f32) -> Self

Create a gyroid surface

Source

pub const fn metric_ball(radius: f32, weights: MetricWeights) -> Self

Create the ball of a weighted norm.

(0, 1, 0) gives a sphere, (0, 0, 1) a cube, (1, 0, 0) an octahedron. Taking a validated MetricWeights is what keeps a non-metric (a negative weight, whose unit ball is not convex) out of the tree.

Source

pub fn metric_blend( inner: Self, outer: Self, center: Vec3, radius: f32, skin: f32, ) -> Self

Blend two fields over a spherical skin: inner within radius of center, outer beyond radius + skin, smoothly joined between.

Outside the bubble the result is outer bit for bit, so a bubble is a local edit of the world and nothing else.

Source

pub const fn heart(size: f32) -> Self

Create a 3D heart

Source

pub fn tube(outer_radius: f32, thickness: f32, height: f32) -> Self

Create a tube (hollow cylinder) along Y-axis

Source

pub fn barrel(radius: f32, height: f32, bulge: f32) -> Self

Create a barrel along Y-axis

Source

pub fn diamond(radius: f32, height: f32) -> Self

Create a diamond (bipyramid)

Source

pub fn chamfered_cube(width: f32, height: f32, depth: f32, chamfer: f32) -> Self

Create a chamfered cube

Source

pub const fn schwarz_p(scale: f32, thickness: f32) -> Self

Create a Schwarz P surface

Source

pub fn superellipsoid( width: f32, height: f32, depth: f32, e1: f32, e2: f32, ) -> Self

Create a superellipsoid

Source

pub fn rounded_x(width: f32, round_radius: f32, height: f32) -> Self

Create a rounded X shape

Source

pub fn pie(angle: f32, radius: f32, height: f32) -> Self

Create a pie (sector) shape

Source

pub fn trapezoid(r1: f32, r2: f32, trap_height: f32, depth: f32) -> Self

Create a trapezoid prism

Source

pub fn parallelogram( width: f32, para_height: f32, skew: f32, depth: f32, ) -> Self

Create a parallelogram prism

Source

pub fn tunnel(width: f32, height_2d: f32, depth: f32) -> Self

Create a tunnel shape

Source

pub fn uneven_capsule(r1: f32, r2: f32, cap_height: f32, depth: f32) -> Self

Create an uneven capsule prism

Source

pub const fn egg(ra: f32, rb: f32) -> Self

Create an egg shape

Source

pub fn arc_shape( aperture: f32, radius: f32, thickness: f32, height: f32, ) -> Self

Create an arc shape (thick ring sector)

Source

pub fn moon(d: f32, ra: f32, rb: f32, height: f32) -> Self

Create a moon (crescent) shape

Source

pub fn cross_shape( length: f32, thickness: f32, round_radius: f32, height: f32, ) -> Self

Create a cross (plus) shape

Source

pub fn blobby_cross(size: f32, height: f32) -> Self

Create a blobby cross (organic) shape

Source

pub fn parabola_segment(width: f32, para_height: f32, depth: f32) -> Self

Create a parabola segment

Source

pub fn regular_polygon(radius: f32, n_sides: u32, height: f32) -> Self

Create a regular N-sided polygon prism

Source

pub fn star_polygon(radius: f32, n_points: u32, m: f32, height: f32) -> Self

Create a star polygon prism

Source

pub fn stairs( step_width: f32, step_height: f32, n_steps: u32, depth: f32, ) -> Self

Create a staircase shape

Source

pub fn helix(major_r: f32, minor_r: f32, pitch: f32, height: f32) -> Self

Create a helix (spiral tube)

Source

pub const fn tetrahedron(size: f32) -> Self

Create a regular tetrahedron

Source

pub const fn dodecahedron(radius: f32) -> Self

Create a regular dodecahedron

Source

pub const fn icosahedron(radius: f32) -> Self

Create a regular icosahedron

Source

pub const fn truncated_octahedron(radius: f32) -> Self

Create a truncated octahedron

Source

pub const fn truncated_icosahedron(radius: f32) -> Self

Create a truncated icosahedron (soccer ball)

Source

pub const fn box_frame(half_extents: Vec3, edge: f32) -> Self

Create a box frame (wireframe box)

Source

pub const fn diamond_surface(scale: f32, thickness: f32) -> Self

Create a diamond surface (TPMS)

Source

pub const fn neovius(scale: f32, thickness: f32) -> Self

Create a neovius surface (TPMS)

Source

pub const fn lidinoid(scale: f32, thickness: f32) -> Self

Create a lidinoid surface (TPMS)

Source

pub const fn iwp(scale: f32, thickness: f32) -> Self

Create an IWP surface (TPMS)

Source

pub const fn frd(scale: f32, thickness: f32) -> Self

Create an FRD surface (TPMS)

Source

pub const fn fischer_koch_s(scale: f32, thickness: f32) -> Self

Create a Fischer-Koch S surface (TPMS)

Source

pub const fn pmy(scale: f32, thickness: f32) -> Self

Create a PMY surface (TPMS)

Source

pub const fn circle_2d(radius: f32, half_height: f32) -> Self

Create a 2D circle extruded along Z

Source

pub const fn rect_2d(half_w: f32, half_h: f32, half_height: f32) -> Self

Create a 2D rectangle extruded along Z

Source

pub const fn segment_2d( ax: f32, ay: f32, bx: f32, by: f32, thickness: f32, half_height: f32, ) -> Self

Create a 2D line segment extruded along Z

Source

pub const fn polygon_2d(vertices: Vec<Vec2>, half_height: f32) -> Self

Create a 2D polygon extruded along Z

Source

pub const fn rounded_rect_2d( half_w: f32, half_h: f32, round_radius: f32, half_height: f32, ) -> Self

Create a 2D rounded rectangle extruded along Z

Source

pub const fn annular_2d( outer_radius: f32, thickness: f32, half_height: f32, ) -> Self

Create a 2D annular (ring) shape extruded along Z

Source§

impl SdfNode

Source

pub fn twist(self, strength: f32) -> Self

Twist around Y-axis

Source

pub fn bend(self, curvature: f32) -> Self

Bend around Y-axis

Source

pub fn repeat_infinite( self, spacing_x: f32, spacing_y: f32, spacing_z: f32, ) -> Self

Infinite repetition

Source

pub fn repeat_finite(self, count: [u32; 3], spacing: Vec3) -> Self

Finite repetition

Source

pub fn noise(self, amplitude: f32, frequency: f32, seed: u32) -> Self

Perlin noise displacement

Source

pub fn round(self, radius: f32) -> Self

Round edges

Source

pub fn onion(self, thickness: f32) -> Self

Create a shell (onion)

Source

pub fn elongate(self, x: f32, y: f32, z: f32) -> Self

Elongate along an axis

Source

pub fn mirror(self, x: bool, y: bool, z: bool) -> Self

Mirror along specified axes

Source

pub fn revolution(self, offset: f32) -> Self

Revolution around Y-axis

Source

pub fn extrude(self, height: f32) -> Self

Extrude along Z-axis

Source

pub fn sweep_bezier(self, p0: Vec2, p1: Vec2, p2: Vec2) -> Self

Sweep along a quadratic Bezier curve in the XZ plane. Control points are (x, z) coordinates.

Source

pub fn taper(self, factor: f32) -> Self

Taper along Y-axis: the child is evaluated at (x, y, z) / (1 − y·factor), narrower at +Y for factor > 0.

The child’s reach ([r_xz, r_y] from its AABB) is computed here and stored in the node; it lets the evaluators bound the parent-space shape by a cone so that the singular plane y = 1/factor is not a phantom surface (see real::taper_bound). Rebuild the node with this constructor after changing the child.

Source

pub fn displacement(self, strength: f32) -> Self

Sin-based displacement

Source

pub fn sine_displacement(self, amplitude: f32, frequency: f32) -> Self

Sin-based displacement with custom amplitude + isotropic frequency (= e.g. frequency 15-30 for fine scale-like patterns、 Vec3::splat 化)

Source

pub fn sine_displacement_aniso(self, amplitude: f32, frequency: Vec3) -> Self

Sin-based displacement with anisotropic per-axis frequency (= e.g. Vec3::new(10.0, 40.0, 10.0) で軸別周波数、 細長菱形鱗用)

Source

pub fn polar_repeat(self, count: u32) -> Self

Polar repetition around Y-axis

Source

pub fn octant_mirror(self) -> Self

Octant mirror (48-fold symmetry)

Source

pub fn shear(self, xy: f32, xz: f32, yz: f32) -> Self

Apply shear deformation

Source

pub fn animated(self, speed: f32, amplitude: f32) -> Self

Apply time-based animation

Source

pub fn with_material(self, material_id: u32) -> Self

Assign a material ID to this subtree

Source

pub fn icosahedral_symmetry(self) -> Self

Icosahedral symmetry (120-fold)

Source

pub fn ifs(self, transforms: Vec<[f32; 16]>, iterations: u32) -> Self

Iterated Function System

Source

pub fn heightmap_displacement( self, heightmap: Vec<f32>, width: u32, height: u32, amplitude: f32, scale: f32, ) -> Self

Heightmap displacement

Source

pub fn surface_roughness( self, frequency: f32, amplitude: f32, octaves: u32, ) -> Self

Surface roughness (FBM noise)

Source§

impl SdfNode

Source

pub fn union(self, other: Self) -> Self

Union with another shape

Source

pub fn intersection(self, other: Self) -> Self

Intersection with another shape

Source

pub fn subtract(self, other: Self) -> Self

Subtract another shape from this one

Source

pub fn smooth_union(self, other: Self, k: f32) -> Self

Smooth union with another shape

Source

pub fn smooth_intersection(self, other: Self, k: f32) -> Self

Smooth intersection with another shape

Source

pub fn smooth_subtract(self, other: Self, k: f32) -> Self

Smooth subtraction of another shape

Source

pub fn chamfer_union(self, other: Self, r: f32) -> Self

Chamfer union with another shape

Source

pub fn chamfer_intersection(self, other: Self, r: f32) -> Self

Chamfer intersection with another shape

Source

pub fn chamfer_subtract(self, other: Self, r: f32) -> Self

Chamfer subtraction of another shape

Source

pub fn stairs_union(self, other: Self, r: f32, n: f32) -> Self

Stairs union with another shape

Source

pub fn stairs_intersection(self, other: Self, r: f32, n: f32) -> Self

Stairs intersection with another shape

Source

pub fn stairs_subtract(self, other: Self, r: f32, n: f32) -> Self

Stairs subtraction of another shape

Source

pub fn xor(self, other: Self) -> Self

XOR (symmetric difference) with another shape

Source

pub fn morph(self, other: Self, t: f32) -> Self

Morph with another shape

Source

pub fn columns_union(self, other: Self, r: f32, n: f32) -> Self

Columns union with another shape

Source

pub fn columns_intersection(self, other: Self, r: f32, n: f32) -> Self

Columns intersection with another shape

Source

pub fn columns_subtract(self, other: Self, r: f32, n: f32) -> Self

Columns subtraction of another shape

Source

pub fn pipe(self, other: Self, r: f32) -> Self

Pipe operation with another shape

Source

pub fn engrave(self, other: Self, r: f32) -> Self

Engrave another shape into this one

Source

pub fn groove(self, other: Self, ra: f32, rb: f32) -> Self

Cut a groove of another shape into this one

Source

pub fn tongue(self, other: Self, ra: f32, rb: f32) -> Self

Add a tongue protrusion of another shape

Source

pub fn exp_smooth_union(self, other: Self, k: f32) -> Self

Exponential smooth union with another shape

Source

pub fn exp_smooth_intersection(self, other: Self, k: f32) -> Self

Exponential smooth intersection with another shape

Source

pub fn exp_smooth_subtract(self, other: Self, k: f32) -> Self

Exponential smooth subtraction of another shape

Source§

impl SdfNode

Source

pub fn translate(self, x: f32, y: f32, z: f32) -> Self

Translate by offset

Source

pub fn translate_vec(self, offset: Vec3) -> Self

Translate by vector

Source

pub fn rotate(self, rotation: Quat) -> Self

Rotate by quaternion

Source

pub fn rotate_euler(self, x: f32, y: f32, z: f32) -> Self

Rotate by Euler angles (radians)

Source

pub fn scale(self, factor: f32) -> Self

Uniform scale

Source

pub fn scale_xyz(self, x: f32, y: f32, z: f32) -> Self

Non-uniform scale

Source

pub fn projective_transform( self, inv_matrix: [f32; 16], lipschitz_bound: f32, ) -> Self

Projective (perspective) transform

Source

pub fn lattice_deform( self, control_points: Vec<Vec3>, nx: u32, ny: u32, nz: u32, bbox_min: Vec3, bbox_max: Vec3, ) -> Self

Lattice deformation (Free-Form Deformation)

Source

pub fn sdf_skinning(self, bones: Vec<BoneTransform>) -> Self

SDF skinning (bone-weight based deformation)

Source§

impl SdfNode

Source

pub const fn category(&self) -> SdfCategory

Returns the category of this node variant

Source

pub fn node_count(&self) -> u32

Count total nodes in the tree

Trait Implementations§

Source§

impl Clone for SdfNode

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SdfNode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SdfNode

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Drop for SdfNode

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Serialize for SdfNode

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.