The 3D Printer Sim — Real STL Slicing, Watch It Print
Upload an STL. Real triangle/plane intersection slicing into 0.2mm layers. Rectilinear cross-hatch infill. The Prusa-style printhead traces each layer, depositing visible plastic beads.
What this is
A 3D FDM printer simulator with real slicing. Upload an STL file (ASCII or binary parsed in-browser) or pick from 6 preset shapes (cube, pyramid, sphere, torus, house, calibration cube). The slicer performs real triangle/plane intersection: for each Z plane spaced 0.2mm apart, intersect every triangle, chain the resulting line segments into closed perimeter loops via greedy endpoint matching, generate rectilinear infill by ray-casting parallel scanlines clipped to the perimeters (alternating angle per layer for cross-hatch). A Prusa-style chassis with correct kinematics (bed slides Y, head slides X, gantry climbs Z on lead screws) animates the toolpath, depositing visible plastic beads (instanced cylinders aligned to motion). Hot end glows orange. Stepper-motor whine pitch follows feedrate. Layer-start clicks. Cross-section toggle reveals infill.
Why this is mind-blowing
Cura, PrusaSlicer, Bambu Studio — these are the printers' essential software, often more complex than the printers themselves. The slicing + visualization at the heart is here in 1664 lines from one paragraph. Upload your own STL. Watch it print.
Single-file 3D printer simulator in three.js. Upload an STL file (or
pick from preset shapes). Slice into 0.2mm horizontal layers. Render
the print bed and an FDM printhead that traces each layer's perimeter
and infill, depositing visible plastic beads. Watch the model rise
off the bed. Cross-section view to see infill.
Paste this into Claude, Cursor, or Copilot. Change one thing that matters to you.
What I learned shipping it
- Real triangle/plane intersection slicing (each triangle vs each Z plane → line segments → chain into closed perimeter loops by greedy endpoint matching) is the canonical FDM slicing algorithm.
- Rectilinear infill via parallel scanline raycasting clipped to perimeters with alternating angle per layer = real cross-hatch infill in 30 lines.
- Correct Prusa-style kinematics (bed slides Y, head slides X, gantry climbs Z on lead screws) makes the animation read as a real printer, not a path follower.