Primitives API
Shape constructors available in Soyuz scripts.
Primitives
sphere
constructorCreates a sphere centered at the origin.
sphere(radius: f64) -> Sdfsphere(0.5)cube
constructorCreates a cube with equal sides, centered at the origin.
cube(size: f64) -> Sdfcube(1.0)box3
constructorCreates a rectangular box with different dimensions per axis.
box3(width: f64, height: f64, depth: f64) -> Sdfbox3(1.0, 0.5, 0.3)rounded_box
constructorCreates a rectangular box with rounded edges.
rounded_box(width: f64, height: f64, depth: f64, radius: f64) -> Sdfrounded_box(1.0, 0.5, 0.3, 0.05)cylinder
constructorCreates a cylinder aligned along the Y axis.
cylinder(radius: f64, height: f64) -> Sdfcylinder(0.3, 1.0)capsule
constructorCreates a capsule with hemispherical caps.
capsule(radius: f64, height: f64) -> Sdfcapsule(0.2, 1.0)torus
constructorCreates a torus in the XZ plane.
torus(major_radius: f64, minor_radius: f64) -> Sdftorus(0.5, 0.1)cone
constructorCreates a cone with its tip at the origin.
cone(radius: f64, height: f64) -> Sdfcone(0.3, 1.0)plane
constructorCreates an infinite plane from a normal and offset.
plane(nx: f64, ny: f64, nz: f64, offset: f64) -> Sdfplane(0.0, 1.0, 0.0, 0.0)ground_plane
constructorCreates a horizontal ground plane at Y=0.
ground_plane() -> Sdfground_plane()ellipsoid
constructorCreates an ellipsoid with different radii per axis.
ellipsoid(rx: f64, ry: f64, rz: f64) -> Sdfellipsoid(0.5, 0.3, 0.4)octahedron
constructorCreates a regular octahedron.
octahedron(size: f64) -> Sdfoctahedron(0.5)hex_prism
constructorCreates a hexagonal prism.
hex_prism(radius: f64, height: f64) -> Sdfhex_prism(0.3, 0.5)tri_prism
constructorCreates a triangular prism.
tri_prism(width: f64, height: f64) -> Sdftri_prism(0.5, 0.3)pyramid
constructorCreates a square-based pyramid.
pyramid(height: f64) -> Sdfpyramid(1.0)link
constructorCreates a chain-link shape.
link(length: f64, major_radius: f64, minor_radius: f64) -> Sdflink(0.35, 0.3, 0.12)extrude_circle
constructorExtrudes a 2D circle into 3D.
extrude_circle(radius: f64, depth: f64) -> Sdfextrude_circle(0.3, 0.5)extrude_rect
constructorExtrudes a 2D rectangle into 3D.
extrude_rect(width: f64, height: f64, depth: f64) -> Sdfextrude_rect(0.5, 0.3, 0.2)extrude_rounded_rect
constructorExtrudes a rounded 2D rectangle into 3D.
extrude_rounded_rect(width: f64, height: f64, radius: f64, depth: f64) -> Sdfextrude_rounded_rect(0.5, 0.3, 0.05, 0.2)revolve_circle
constructorRevolves a 2D circle around the Y axis.
revolve_circle(radius: f64, offset: f64) -> Sdfrevolve_circle(0.1, 0.5)revolve_rect
constructorRevolves a 2D rectangle around the Y axis.
revolve_rect(width: f64, height: f64, offset: f64) -> Sdfrevolve_rect(0.2, 0.1, 0.4)