trimesh.viewer.notebook module

notebook.py

Render trimesh.Scene objects in HTML and jupyter notebooks using three.js

Functions

in_notebook()

Check to see if we are in an IPython or Jypyter notebook.

scene_to_html(scene)

Return HTML that will render the scene using

scene_to_notebook(scene[, height])

Convert a scene to HTML containing embedded geometry and a three.js viewer that will display nicely in an IPython/Jupyter notebook.

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