OpenBSD Journal

3D printing on OpenBSD? Yes, that’s a thing!

Contributed by Ian Darwin on from the 'What else can you do with it?' dept.

Can you really do 3D printing from OpenBSD? Cue suspenseful music whilst I formulate my answer, which is: Yes.

If you aren’t familiar with the 3D printing process, it’s divided into several steps, vaguely analogous to writing, compiling and running a program in a compiled language.

  • Design (CAD) The design tool gets you from an idea to an exact specification - like writing and editing a source code file. The most common format for these is STL, standing for stereolithography, what 3D printing was originally called.
  • Slicing - convert to layers The “slicing” converts the file from STL to‘g-code’, analogous to compiling a program. These codes represent each layer with a set of movements for the 3d print head to follow. The g-code format originated decades ago for use in numerical controlled machining, and the pioneers of 3D printing wisely adopted and adapted this format for the needs of 3D printers.
  • Download to 3D printer The downloading is analogous to loading a compiled program into a program that can run it, like qemu or the Java runtime. The g-code is interpreted by the 3D printer to make the finished article.
Busy screenshot of all three steps
Fig. 1 - A CAD tool, a slicer, and a downloader.

Design

OpenSCAD has been in ports for quite some time. At g2k23 I worked on a port of another 3D CAD tool, solvespace, ported by Johannes Thyssen Tishman and Jerome Kasper, and imported by me shortly after. These are both “parametric” tools, e.g., specify that these two parts must meet at exactly 45 degrees, that this part shall be so many units wide, etc. OpenSCAD also has a very nice menu system allowing you to edit the parameters of the job. I’m using this to make labels for a club I belong to, working from Xavier Faraudo’s versatile name tag kit. Having configured the project as I want it, I can just open the file, enter the member’s first and last names, and hit Render. Moments later it spits out an STL file, ready for slicing.

Some people use Blender (which has been in ports for ages) to do 3D modelling. There are also web-based design tools such as Tinkercad, which is easy to use and free to use, but may be a “portal drug” to the proprietary CAD software sold by Tinkercad’s sponsor, Autodesk.

Slicing

While at g2k23, I was in touch by email by Johannes Thyssen Tishman to work on a port of PrusaSlicer 2.6.1. There are several dependencies that make it harder to port to 2.6.1 compared with 2.5.2. I did some work on the replacement for oce needed for 2.6.1, but that wound down inconclusively.

Then in Sept 2023, Renato Aguiar circulated his completed port of PrusaSlicer 2.5.2. I needed to try this out at once! I took the 45 minute print job formatted with openscad (see above under Design), sliced it with Prusaslicer, and it printed fine. All on OpenBSD.

With feedback from Johannes and an OK from jcs@, I committed this port into the tree in mid-September, 2023. This was the last major step in completing the ability to do 3D printing, since the downloading step (below) doesn’t need any new software to be ported.

Note that, despite being from Prusa, this software can slice and dice STL code for almost any modern printer, either FDM (filament) or SLA (resin). It comes with profiles for a large range of printers, but even if your printer isn’t already known, you can probably configure it to work. In fact, some Prusa competitors like Bambu Labs make their own slicers… based on PrusSlicer. PrusaSlicer in turn was based on an earlier slicer called Slic3r. Open source works that way.

Downloading

The download step could be completed by sneakernet (putting the file on a USB stick and walking it over to the printer), but that’s pretty low bandwidth. There are at least two better ways.

There’s a free open source project called OctoPrint that provides great downloading and monitoring of most 3D printers. This software can be run on a Raspberry PI (where it’s called OctoPI), connecting to most brands of printers via USB. There are also downloads for other platforms such as Android. The standard version is controlled by a web browser like Firefox on your desktop, and is used for sending files to your printer, starting and monitoring them, etc.

With a Prusa MK4 printer, you don’t even need the Raspberry PI. Prusa printer’s firmware includes a built-in web server and a web app called PrusaLink. This is invoked from your desktop just by giving the printer’s Ethernet or WiFi IP4 address as the browser URL, e.g., http://10.1.1.42/. You log in with a username of maker and a password randomly chosen by the printer itself (available on the printer’s LCD screen). There’s no UI for changing this password, so one suspects it’s a hash of the printer’s serial number. I’ve used PrusaLink a lot over wired Ethernet and it has been reliable, though I've heard complaints from people using it over WiFi.

Happy Ending

I’m glad to say that we can now perform the whole 3D print workflow on OpenBSD. Use one of the design tools openscad or solvespace to generate the STL file. Use PrusaSlicer to generate the g-code. Then use prusalink or octoprint via FireFox or Chromium to feed the g-code from your desktop to the printer, and to start and monitor the printing. Everything you need is now in the OpenBSD ports tree, and will be included in packages soon, probably by the time you read this.

Thanks to Johannes and Renato for work on PrusaSlicer, and to everyone else who helps to make OpenBSD usable as one’s all-in-one operating system.

Future Work

The next steps will probably be an upgrade of PrusaSlicer from 2.5.2 to 2.6.1 - this brings major improvements - and the addition of additional cad tools, perhaps FreeCAD.

(Comments are closed)


Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]