Viewer
- class compas_notebook.viewer.Viewer(config=None, controller=None)
Bases:
object
Viewer for COMPAS geometry in Jupyter notebooks.
- Parameters:
- config
Config
, optional A configuration object.
- configpathpath-like or str, optional
The path to a configuration file.
- scene
Scene
, optional A COMPAS scene, with context set to “Notebook”.
- controller
Controller
, optional A custom action controller.
- config
Examples
This example is meant to be run from within a Jupyter notebook.
>>> import compas >>> from compas.datastructures import Mesh >>> from compas_notebook.viewer import Viewer >>> mesh = Mesh.from_obj(compas.get("tubemesh.obj")) >>> viewer = Viewer() >>> viewer.scene.add(mesh) >>> viewer.show()
Methods
Initialize the user interface.
Initialize the main section of the user interface.
Initialize the status bar.
Initialize the toolbar.
Set the text of the status bar.
Display the viewer in the notebook.
Update an existing viewer instance.