trimesh.viewer.notebook
notebook.py
Render trimesh.Scene objects in HTML and jupyter notebooks using three.js
- trimesh.viewer.notebook.in_notebook()
Check to see if we are in an IPython or Jypyter notebook.
- Returns
in_notebook – Returns True if we are in a notebook
- Return type
bool
- trimesh.viewer.notebook.scene_to_html(scene)
Return HTML that will render the scene using GLTF/GLB encoded to base64 loaded by three.js
- Parameters
scene (trimesh.Scene) – Source geometry
- Returns
html – HTML containing embedded geometry
- Return type
str
- trimesh.viewer.notebook.scene_to_notebook(scene, height=500, **kwargs)
Convert a scene to HTML containing embedded geometry and a three.js viewer that will display nicely in an IPython/Jupyter notebook.
- Parameters
scene (trimesh.Scene) – Source geometry
- Returns
html – Object containing rendered scene
- Return type
IPython.display.HTML