Quick Start
Create your first 3D model in 5 minutes.
The simplest script
A Soyuz script is a Rhai file that returns an SDF (Signed Distance Field). The simplest possible script:
simple.rhai
sphere(0.5)This creates a sphere with radius 0.5 units, centered at the origin.
Combining shapes
Use method chaining to combine primitives:
combine.rhai
// Union: combine two shapes
sphere(0.5).union(cube(0.7))
// Subtract: cut one from another
cube(1.0).subtract(sphere(0.8))
// Intersect: keep only the overlap
sphere(0.6).intersect(cube(0.8))Transforms
Move, rotate, and scale shapes:
transforms.rhai
// Move a shape
sphere(0.3).translate(1.0, 0.0, 0.0)
// Rotate (angles in radians, use deg() for degrees)
cube(0.5).rotate_y(deg(45.0))
// Scale uniformly
torus(1.0, 0.3).scale(0.5)Variables and logic
Rhai supports variables, loops, and conditionals:
cup.rhai
let radius = 0.4;
let height = 1.0;
// Build a simple cup
let body = cylinder(radius, height);
let hollow = cylinder(radius - 0.05, height - 0.1)
.translate_y(0.05);
let handle = torus(0.15, 0.04)
.rotate_x(deg(90.0))
.translate(radius + 0.1, 0.0, 0.0);
body.subtract(hollow).union(handle)Preview and export
In Soyuz Studio:
- Press
Ctrl+Enterto preview your model in a 3D window - Use
Ctrl+Eto open the Export panel - Choose format (GLB, GLTF, OBJ, or STL) and export
Key rule
Your script must return an SDF. This means the last expression should not end with a semicolon. If nothing renders, check that your final line returns a shape.