jupyter-widgets / pythreejs

A Jupyter - Three.js bridge
https://pythreejs.readthedocs.io
Other
942 stars 188 forks source link

Possible to "detach" cell output window in pythreejs similar to what is available in K3D? #312

Open Krande opened 4 years ago

Krande commented 4 years ago

Hi,

I recently discovered pythreejs and I have to say I am thoroughly impressed in how easy it is to work with! It's a great tool and a great fit in my daily work flow!

One thing I was just curious about (and I don't see any mentioning of it in the issues section or documentation) is if it is possible to build a mechanism to "detach" the rendering in the cell-output window in a similar fashion as what they do in K3D (exemplified in the figures below)? For my part, being able to go full-screen using a detached window can be useful when it comes to more complex models.

image

image

You might ask "why not then use k3d"? Well, from what I can tell, it appears that there is no way of building line geometry in segments using indices in an efficient manner using k3d (which is a drag, as I need that for rendering my FEM models, which unfortunately are not built up from one continuous line). This however, is easier using pythreejs, like so;

mesh = p3s.LineSegments(geometry=geometry, material=material, type='LinePieces')

If anyone think this can be done using the existing pythreejs framework, I would really appreciate any hints as to where to start! I have no problems with building buttons and connecting them to events in python, but when it comes to the inner workings in html and javascript I am far from experienced.

Anyways, keep up the great work!

Best regards, Kristoffer

vidartf commented 4 years ago

Thanks for the kind words. I don't know any ways to make this happen with the current code base, buit it should be technically possible by adding some JS code. I'd love to help out, but unfortunately I don't have the time right now :(

Krande commented 4 years ago

No worries. I know how it is. I found something that might do the trick here. I will see if this together with the embed_snippet might do what I am after.