Thursday, October 27, 2016

VPython Inside Jupyter Notebooks

Vpython in Jupyter Notebook

Getting Vpython working inside of Jupyter Notebooks is not as difficult as I'd surmised.

Check it out on Github.  The rendering machine at Github won't invoke an actual scene.  For that, you'll need to run the notebook locally, with Vpython installed.  I'm using Python 3.5 in this instance.

I'm doing the Oregon Curriculum Network thing (OCN), coding up Vector, Edge, and Polyhedron in the stickworks tradition.  Two tetrahedrons will do.  I haven't gone on to wire the corresponding Cube.

An Edge is defined by two vectors.  The six green cylinders displayed above are edges.  Vectors also draw themselves directly and show up in cyan.

Another Angle