compas_notebook.viewer
¤
Classes¤
Viewer
¤
Viewer for COMPAS geometry in Jupyter notebooks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
:class:`Config`
|
A configuration object. |
None
|
configpath
|
path - like or str
|
The path to a configuration file. |
required |
scene
|
:class:`Scene`
|
A COMPAS scene, with context set to "Notebook". |
required |
controller
|
:class:`Controller`
|
A custom action controller. |
None
|
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()