r/OpenPythonSCAD • • Dec 16 '24

PythonSCAD as iPython

Today I managed to get PythonSCAD working as interactive python interpreter,

with all PythonSCAD functionality included, see yourself

https://www.youtube.com/watch?v=TymFtcB8K8E

Next task is to head towards Jupyter Notbook, but I am lacking some knowledge.

Who is interested in supporting me ?

4 Upvotes

14 comments sorted by

View all comments

Show parent comment

2

u/rebuyer10110 Jan 22 '25

That is awesome news!

Can you tell more what you mean by "fit into an Jupyter kernel"? Do I need to compile or modify a local Jupyter runtime to do this, or it can be loaded into a standard Jupyter runtime?

1

u/gadget3D Jan 22 '25 edited Jan 22 '25

jupyter kernels talk a special network protocol which is used to communicate to the jupyter client/web interface. basically command input and command output are transmitted.

This protocol is implemented by libxeus , and yes: pythonscad links it.

after that is done a simple file has to be installed somewhere in /sr/share/jupyter/kernels.

after that pythonscad can be selected as a kernel in the jupter lab

1

u/rebuyer10110 Jan 22 '25

Also: I was able to render in google colab (they use jupyter) with jupyterscad.

https://colab.research.google.com/gist/willywong/e4918a3de8468057a3b1b544f9a1abc8/jupyterscad.ipynb

It does use an openscad installation under the covers. Since you were able to have pythonscad working in ipython, there might be a way to expose the openscad binaries to be called by jupyterscad to render.