Resin-based SLA printers need a different slicing algorithm from “normal” melted-plastic printers. Following their latest hackathon, [Matt Keeter] and [Martin Galese] from Formlabs have polished off an open source slicer, and this one runs in your browser. It’s Javascript, so you can go test it out on their webpage.
Figuring out whether or not the voxel is inside or outside the model at every layer is harder for SLA printers, which have to take explicit account of the interior “empty” space inside the model. [Matt] and [Martin]’s software calculates this on the fly as the software is slicing. To do this, [Matt] devised a clever algorithm that leverages existing hardware to quickly accumulate the inside-or-out state of voxels during the slicing.
[Matt] is stranger to neither 3D mesh manipulation nor Hackaday. If you’re just getting started in this realm, have a look at Antimony, [Matt’s] otherworldly CAD software with a Python interface to get your feet wet with parametric 3D modeling.
From their description:
This slicer uses a stencil buffer trick to implement the algorithm entirely on the GPU. This isn’t a new idea, but it’s a neat idea that deserves to be explained.
The model is positioned so that the target slice is at the very edge of OpenGL’s clipping box, then rendered with three passes (with depth testing turned off):
In the first pass, the stencil buffer increments on front-facing fragments
In the second pass, the stencil buffer decrements on back-facing fragments
In the third pass, we discard any fragments where the stencil buffer is zero
This executes the raycasting algorithm described above, done in parallel and with all of the hard work offloaded to the GPU.
In a CPU implementation, the tricky part would be figuring out which triangles intersect various rays. Here, we get all of that for free!
Genius. You could even do it with OpenGL 1.0 cards.
Getting your 3dfx Voodoo3 2000 working again might be the hardest part : )
How about an ATI Rage II?
this is exactly how we used to draw things like dynamic shadows in games back then
It does depend on a 100% manifold mesh. Which is… not always the case. Still, it IS the quickest way to generate slices for SLA printing.
Oh dear… Not even the creator of this piece of software did mention this: THIS IS A SLS SLICER – to be a SL-A Slicer, you have to support… support!! Gravity is a bitch!