Dual-head laser sculptor
A Three.js proof of concept. Two tilting laser scanners, a shared gantry, and a solid voxel workpiece. Editable programs, gradual cutting, and stops for collisions or stray beams.
From initial concept to finished demo in about two hours with GPT6-Astra. I tested it throughout, prompting multiple revisions and small adjustments.
Start with Run to sculpt the cube. The pawn takes about seven simulated minutes; use accelerated playback, then Inspect stock and drag to examine the result. Every cut comes from the program.
Loading program…
Variables appear here while the program runs.
Loading the 3D view…
Program reference & simulation model
LET pitch = 2 · pitch += 0.5- Declare and update variables. Expressions support + − * / %, powers with ^, and parentheses.
FOR i FROM 0 TO 40 STEP 2 { … }- Indexed loop, inclusive end, STEP defaults to 1. REPEAT 5 { … } repeats a block without an index. Up to four nested loops.
IF row % 2 == 1 { … }- Conditional block. Comparisons: == != < > <= >=. Combine conditions with && or ||.
SIN(a) · COS(a) · SQRT(a) · EXP(a)- Angles are in radians; PI is built in. ABS, MIN, and MAX are also available. Keywords and variable names are case-insensitive.
MOVE Y=20 X1=12 X2=44 Z1=72 Z2=75- Coordinated absolute move. Both heads share Y; X and Z are independent. Omitted axes stay put. STEP uses relative distances. Z is the physical scanner pivot height.
FEED 12 · WAIT 2- Feed limits the faster head to 12 mm/s; both arrive together. WAIT dwells for seconds, continuing to cut if enabled.
POWER H1=75 H2=90- Programmed power in percent. RADIUS H1=1.5 sets the beam radius in mm. Power scales below the view multiply these settings live.
TILT H1=45 H2=90 · AZIMUTH H1=0 H2=180- Scanner angles in degrees: tilt 0 points down, 90 is horizontal. Azimuth 0 points toward +X, 90 toward +Y. Settings change immediately; switch beams off before reorienting or repositioning.
RANGE H1=40 H2=40- Requested cutting distance from the lens along each beam, in mm. The lens sits 4.2 mm forward of the pivot. Effective reach is the smaller of RANGE and 1.8 × effective power percent. Reach in the telemetry includes the live power scale.
LASER BOTH ON / OFF- Switch both lasers together, or address H1 or H2. All lasers turn off at program completion or a collision stop.
Write one instruction per line and put each closing brace on its own line. # starts a comment. Variables declared inside a block remain available; a FOR index is local to its loop. Assignment also supports -=, *=, and /=. Expressions are interpreted by a small bounded language, not executed as JavaScript.
One Y gantry carries both X carriages. H1 must remain left of H2 with at least 8 mm separation, regardless of Z. Travel limits: X1/X2 −16…76 mm, shared Y −10…70 mm, scanner Z1/Z2 5…88 mm. The side clearance allows horizontal machining with the heads outside the cube. The scanner envelope includes the tilting optic.
The 60 mm cube contains 3,375,000 voxels at 0.4 mm resolution. Material is removed in 3D, so tunnels, overhangs, and detached pieces are possible. Only exposed surfaces are drawn. Unconnected material stays in place: this model does not simulate gravity.
Arrowheads show beam direction. A filled red dot marks material contact; a hollow ring in the head’s colour marks the range endpoint in air. Opposing beams can overlap without reaching either head. Each beam is a circular bundle of parallel rays. Solid material occludes what is behind it until enough exposure removes it. Power controls cutting speed and maximum reach; dose decreases with distance by 1 / (1 + distance / 100)². RANGE is an explicit distance cutoff, not a physically calibrated laser property. Beam radius is 0.4…2 mm; angles are degrees while SIN/COS expressions use radians.
A mechanical collision or beam hitting the bed, fixture, gantry, slide, or other head stops execution and disables both lasers. The red X marks the contact and the editor highlights the responsible line. Material can shield hardware until it is cut through. This sampled geometric model is an experiment, not machine-control or safety software.
Editing pauses execution; the next run starts with fresh stock. Loading a preset replaces the editor. Step advances 0.1 simulated seconds. Playback accelerates time, not cutting strength; large cuts may run slower than the selected speed. There is no calibrated laser physics, melting, reflection, or plasma model.