discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Jupyter Notebook integration (was Hosting OpenSCAD Files (was Re: Is it possible to write out a text file from OpenSCAD?))

WA
William Adams
Wed, May 30, 2018 6:32 PM

My apologies --- I think I have two separate trains of thoughts here. I am
going to defer on the hosting thing for a bit, and focus on the Jupyter
Notebook thing:

On Wed, May 30, 2018 at 2:06 PM, doug moen doug@moens.org wrote:

Implementing the protocol is not straight-forward.

Jupyter is a web application. The user interface runs in a web browser.
The kernel runs in a separate process, and communicates with the front end
using a JSON encoded network protocol.

Okay, but I just worked up a way to get the JSON encoded presets from the
customizer out of OpenSCAD and into lualatex --- so my understanding here
is that what I'd need to do (for my purposes) is:

  • set up a Jupyter Notebook which references OpenSCAD in an external file
  • allows one to plug in a preset as a starting point
  • launches OpenSCAD with that preset of that that file loaded / active ---
    one then changes the parameters and saves the preset
  • Jupyter Notebook reads the JSON file back in and loads the values from
    the preset, storing them in the notebook and using them at need

(My apologies, I'm thinking out loud here after a holiday weekend with
family and too much coffee, and sugar, culminating in a breakfast heavy
in foods affected by the Maillard Reaction --- all I need is a cigarette or
a nap or something).

On the gripping hand, the "correct" way is supposed to be easy:

Thanks!

William

My apologies --- I think I have two separate trains of thoughts here. I am going to defer on the hosting thing for a bit, and focus on the Jupyter Notebook thing: On Wed, May 30, 2018 at 2:06 PM, doug moen <doug@moens.org> wrote: > Implementing the protocol is not straight-forward. > > Jupyter is a web application. The user interface runs in a web browser. > The kernel runs in a separate process, and communicates with the front end > using a JSON encoded network protocol. > Okay, but I just worked up a way to get the JSON encoded presets from the customizer out of OpenSCAD and into lualatex --- so my understanding here is that what I'd need to do (for my purposes) is: - set up a Jupyter Notebook which references OpenSCAD in an external file - allows one to plug in a preset as a starting point - launches OpenSCAD with that preset of that that file loaded / active --- one then changes the parameters and saves the preset - Jupyter Notebook reads the JSON file back in and loads the values from the preset, storing them in the notebook and using them at need (My apologies, I'm thinking out loud here after a holiday weekend with family and too much coffee, and sugar, culminating in a breakfast heavy in foods affected by the Maillard Reaction --- all I need is a cigarette or a nap or something). On the gripping hand, the "correct" way is supposed to be easy: >https://github.com/ipython/ipython/wiki/IPython-kernels-for-other-languages Thanks! William