pybosl2 - ported bosl2 to pythonscad

27 views
Skip to first unread message

David Bennett

unread,
Aug 10, 2026, 6:34:40 PMAug 10
to pytho...@googlegroups.com
Morning,

I've been working on porting this over to pythonscad.  This is not a 100% a direct port, I pulled it over and made several changes to make the API more Python-friendly.

Code:
Docs:

Includes
 all the parts for the bosl2 library plus 
* all the operations on cubes/squares/strokes/paths and regions.  
svgs as multi-color regions so it is possible to import an svg with colors from the svg and extrude this with all the colors correct pretty easily.  
* render with sdf or csg, which is using libfive or not.  livefive does really nice looking shapes, but they do take much longer to generate.

Using this to generate my own libraries that I have for boxes and board game boxes.  I'm finding it works well and has made it much easier to improve the performance of building complicated shapes.  This depends on Shapely and NumPy for internal operations.

If people would like to take a look, the documentation includes good examples and code, although the STL rendering is not working correctly right now.

Hope this is helpful, found it a hard to use my own systems in pythonscad without this as a basis.

Thanks!
David.


Matthieu Hendriks

unread,
Aug 11, 2026, 2:13:03 AMAug 11
to David Bennett, pytho...@googlegroups.com
Wauw, I'll certainly have a look into this. 

Op di 11 aug 2026 om 00:34 schreef David Bennett <pinkfi...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "PythonSCAD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pythonscad+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/pythonscad/CAN21a4Q6X9_C7t8tAHUvk%2BCeb2t3-xOVnRd%2Bng6TaGDm2U4z8A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Guenther Sohler

unread,
Aug 12, 2026, 7:17:10 AM (14 days ago) Aug 12
to David Bennett, pytho...@googlegroups.com
Hey that's great. I am excited that you have an Sdf section and you try to establish that transparent next to CSG. That's definitely a feature which original bosl2 does not have. I'd love to see more about that and what people come up with. Thank you for your effort!
--
You received this message because you are subscribed to the Google Groups "PythonSCAD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pythonscad+unsubscribe@googlegroups.com.


--
Null

Todd Allen

unread,
Aug 19, 2026, 2:58:13 PM (6 days ago) Aug 19
to PythonSCAD
I got the .zip from the github and copied the pybosl2 folder to my OpenSCAD libraries folder.  In my pythonscad .appimage I ran:

from pythonscad import *
from pybosl2 import cuboid
part = cuboid([20, 20, 10]).up(5)

and got an error :

Running Python 3.12.3 in venv '/home/user/Documents/pythonscad/mypyenv'.

ModuleNotFoundError: No module named 'webcolors'


Then I tried:
user@CAD:~/Documents/pythonscad$ source mypyenv/bin/activate
(mypyenv) user@CAD:~/Documents/pythonscad$ pip install webcolors
/home/user/Documents/pythonscad/mypyenv/bin/pip: line 3: import: command not found

I'm guessing the first line of the pip script is failing to invoke python but I don't know why
#!/home/user/Documents/pythonscad/mypyenv/bin/pythonscad-python

Can anybody help me sort this out?

John David

unread,
Aug 19, 2026, 4:24:06 PM (6 days ago) Aug 19
to Todd Allen, PythonSCAD
pip install typically installs in system space, while mypyenv/bin/activate implies you are using Anaconda, VirtualBox, or similar environment managers.  If you used, say, anaconda, then look at the process anacond uses to install a new package (IIRC "conda install webcolors, or similar)

Hope that helps!

  EBo --

--
You received this message because you are subscribed to the Google Groups "PythonSCAD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pythonscad+...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/pythonscad/f9396534-ad3d-421a-a197-ea23aedb7c4en%40googlegroups.com.

Todd Allen

unread,
Aug 19, 2026, 5:26:47 PM (6 days ago) Aug 19
to John David, PythonSCAD
I used pythonscad's create a virtual environment from the file menu.  I then attempted to use the pip script from within the activated environment.

David Bennett

unread,
Aug 19, 2026, 5:41:33 PM (6 days ago) Aug 19
to Todd Allen, John David, PythonSCAD
Yes, it seems to be failing to install the dependencies, which is annoying they look to be correct in the toml file.  It doesn't seem to auto install shapely either.  Will fix that.

I have been using it inside of pythonscad in an virtual environment for the box suite work I have been working on too:

The dependencies it has is webcolors, shapely and numpy

Thanks,
David.



Reply all
Reply to author
Forward
0 new messages