and how to port python apps to OpenBSD!
- Modeling (or finding) what you are going to print.
- Slicing.
- Printing.
This is an entire talk in and of itself, however, you have lots of choices!
Name | Open | Ease of Use | OPFF* |
---|---|---|---|
Blender | Yes | Easy, don't let the UI scare you! | Yes |
OpenSCAD | Yes | Code Oriented | Yes |
Sketchup | No | Very Easy | Yes (with plugin) |
** Output Printer Friendly Files*
Many objects have already been created, so search first, create later!
What the heck is slicing? Why do we need it?
Have you ever done the "Robot Programming" exercise?
Slicing is basically cutting a 3D model into commands that the printer turns into physical actions (think Robot Programming.. go forward 3 steps, turn left).
Generally slicers produce G-Code which is the final format printing apps like OctoPrint use.
- Controllers on 3D printers are fairly basic, can't run large code base.
- 3D objects need to be represented in a linear set of instructions.
Robot Code
forward(3);
turn('Left');
G-Code
G01 X114.395 Y115.288 F1080.000
Not really a one to one - but you get the idea :D
Name | Open | Ease of Use |
---|---|---|
Cura | Yes | Easy |
Slic3r | Yes | Medium |
Once the model is converted to G-Code, we are ready to print with some kind of printing app!
Name | Open | Ease of Use |
---|---|---|
Pronterface | Yes | Medium |
Cura | Yes | Easy |
OctoPrint | Yes | Easy |
There are many more apps that can be used!
Porting 3D printing apps to OpenBSD using the magic that is the ports system!
Usually this is a go-until-failure kinda thing, but sometimes you get a break!
OctoPrint has a list of required python modules included in the github repo!
Searching the ports tree with make search key=<item>
reveal we are missing 4 of the required libs.
Fortunately for us the reqs are all on PyPI and ports has facilities for grabbing stuff from there!
Now we build our Makefile
! You can use /usr/ports/infrastructure/templates/Makefile.template
, or copy an existing PyPI
port.
Here is a Makefile for py-flask-login
(white space removed for slide)
COMMENT = user session management for flask
MODPY_EGG_VERSION = 0.2.11
DISTNAME = Flask-Login-${MODPY_EGG_VERSION}
PKGNAME = py-${DISTNAME:L}
CATEGORIES = www
HOMEPAGE = https://github.com/maxcountryman/flask-login
# MIT
PERMIT_PACKAGE_CDROM = Yes
MASTER_SITES = ${MASTER_SITE_PYPI:=F/Flask-Login/}
MODULES = lang/python
RUN_DEPENDS += www/py-flask
MODPY_SETUPTOOLS = Yes
.include <bsd.port.mk>
MASTER_SITES = ${MASTER_SITE_PYPI:=F/Flask-Login/}
This bit of magic tells the ports system to grab a tarball from PyPI
For a more comprehensive list of available MASTER_SITES
check out:
/usr/ports/infrastructure/templates/network.conf.template
Once we have our Makefile in place we can test the fetching of our DISTFILE with make fetch
.
If all goes well you will see a progress bar showing the file you expected downloading.
Now we need to create the SHA256
checksum contained in the distinfo
file associated with the port.
Ports has your back! make makesum
will generate your distinfo
file!
qbit@qbit[0]:/usr/ports/www/py-flask-loginλ make makesum
===> Checking files for py-flask-login-0.2.11
>> Fetch http://pypi.python.org/packages/source/F/Flask-Login/Flask-Login-0.2.11.tar.gz
Flask-Login-0.2.11.tar.gz 100% |***************************************************************************************************************************************| 11099 00:00
>> Checksum file does not exist
qbit@qbit[0]:/usr/ports/www/py-flask-loginλ cat distinfo
SHA256 (Flask-Login-0.2.11.tar.gz) = g9XxDlxPIU/u1sxBwhLbY6WKFawy5W34FZG/oKXO4+U=
SIZE (Flask-Login-0.2.11.tar.gz) = 11099
Next steps are:
- create pkg/DESCR
- install your package!
- repeat!
Once all the reqs are in, we are ready to print with OctoPrint!