Scene
- class compas.scene.Scene[source]
Bases:
Data
A scene is a container for hierarchical scene objects which are to be visualised in a given context.
- Parameters:
- namestr, optional
The name of the scene.
- contextstr, optional
The context in which the scene is visualised. Will be automatically detected if not specified.
Examples
>>> from compas.scene import Scene >>> from compas.geometry import Box >>> scene = Scene() >>> box = Box.from_width_height_depth(1, 1, 1) >>> scene.add(box) >>> scene.draw()
- Attributes:
- tree
compas.scene.SceneTree
The underlying tree data structure of the scene.
- objectslist[
compas.scene.SceneObject
] All scene objects in the scene.
- tree
Methods
Add an item to the scene.
Clear the current context of the scene.
Clear all objects inside the scene.
Draw the scene.
Print the hierarchy of the scene.
Remove a scene object from the scene.
Inherited Methods
Converts the instance to a string.
Make an independent copy of the data object.
Construct an object of this type from a JSON file.
Construct an object of this type from a JSON string.
Compute a hash of the data for comparison during version control using the sha256 algorithm.
Convert an object to its native data representation and save it to a JSON file.
Convert an object to its native data representation and save it to a JSON string.
Validate the data against the object's data schema.