osg.js widget

38 views
Skip to first unread message

Lorenz L.

unread,
Oct 4, 2017, 11:50:02 AM10/4/17
to Project Jupyter

I would like to use osg.js [1] as a viewer for pivy [2] which provides python bindings to coin3d [3]. As a result this viewer should work to display FreeCAD [4] models in the jupyter-notebook. The problem is, that I have no idea about javascript side. So maybe someone more experienced can give a short statement if something like this is acchievable...

The following things will be needed:
- convert the scene-graph from python/c++ to osg.js
- make callbacks to python (pivy) / c++ (coin3d)

[1] http://osgjs.org/
[2] https://github.com/FreeCAD/pivy
[3] https://bitbucket.org/Coin3D/coin/wiki/Home
[4] https://www.freecadweb.org/

Jason Grout

unread,
Oct 9, 2017, 10:37:13 AM10/9/17
to Project Jupyter
Using the ipywidgets framework would be a natural way to do this - it provides a way to automatically sync data between the web browser and the kernel. For example, we have a scenegraph-like api already with pythreejs (wrapping three.js), which can call back to python code when the camera viewpoint changes, when the user picks a point in the 3d scene, etc.

If you needed to use osg.js, someone would need to write code wrapping osg.js and exposing it to the notebook. If you could use the scenegraph for pythreejs, then perhaps all that is needed for basic functionality is converting from freecad into the pythreejs scenegraph.




On Wed, Oct 4, 2017 at 8:50 AM Lorenz L. <spped...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages