Plan 9: 3D Printing
Slice
Slice the STL (stereolithography) model to generate Gcode for the printer.
stl2m <part.stl | place -c | layers -l 200 | walls | skin | infill | support | gcode -p ender3 > part.gcode
You can also set PRINTER3D=ender3 to avoid passing it in the command line. The profiles are looked up in the /lib/slicer directory.
Visualize
Visualize the STL, OBJ (file format originally developed by Wavefront Technologies) or the gcode file.
3dview part.stl
3dview -g part.gcode
# convert OBJ to STL for viewing
obj2stl -Y bunny.obj > bunny.stl
Keyboard shortcuts:
- Arrows: rotate (left/right yaw, up/down pitch), 5 degrees per press.
- + / -: zoom in/out.
- o: toggle orthogonal and perspective.
- w: cycle wire, shaded, shaded+edges. Meshes only - ignored for gcode.
- r: reset the view.
- q or Del: quit.
Mouse:
- Button 1 drag: rotate.
- Button 2 drag: pan.
- Wheel: zoom.
- Button 1 on the bottom bar (gcode): layer slider.
Stream G-code to a serial 3D printer
gcsend [-v] [-d dev] [-b baud] [file.gcode]
Test
The code is modular so each stage can be tested separately. Run the test harness:
rungolden golden.txt
Read stream.txt for the format internals.
Code

Comments
Post a Comment