honeybee_vtk.scene module¶
A VTK scene.
-
class
honeybee_vtk.scene.
Scene
(background_color: Optional[Tuple[int, int, int]] = None, actors: Optional[List[honeybee_vtk.actor.Actor]] = None, cameras: Optional[List[honeybee_vtk.camera.Camera]] = None, text_actor: Optional[honeybee_vtk.text_actor.TextActor] = None)[source]¶ Bases:
object
Initialize a Scene object.
Vtk derives inspiration from a movie set in naming its objects. Imagine a scene being prepared at a movie set. The scene has a background. It has a few actors, there are assistants running around making sure everything is ready, and there are a few cameras setup to capture the scene from different angles. A scene in vtk is defined in the similar fashion. It has a background color, some actors i.e. geometry objects from model, a few cameras around the scene, and assistants equal the number of cameras setup in the scene.
- Parameters
background_color – A tuple of three integers that represent RGB values of the color that you’d like to set as the background color. Defaults to white.
actors – A list of Actor objects to be added to the scene. Defaults to None.
cameras – A list of Camera objects to be added to the scene. Defaults to None.
text_actor – A TextActor object to be added to the scene. Defaults to None.
-
add_actors
(val: Union[honeybee_vtk.actor.Actor, List[honeybee_vtk.actor.Actor]]) → None[source]¶ add honeybee-vtk Actor objects to a Scene.
- Parameters
val – Either a list of Actors objects or a single Actor object.
-
add_cameras
(val: Union[honeybee_vtk.camera.Camera, List[honeybee_vtk.camera.Camera]]) → None[source]¶ Add a honeybee-vtk Camera objects to a Scene.
- Parameters
val – Either a list of Camera objects or a single Camera object.
-
add_text_actor
(val: honeybee_vtk.text_actor.TextActor) → None[source]¶ Add a TextActor object to the scene.
-
export_gltf
(folder: str, name: str = 'Camera') → str[source]¶ Export a scene to a glTF file.
- Parameters
folder – A valid path to where you’d like to write the gltf file.
name – Name of the gltf file as a text string.
- Returns
A text string representing the path to the gltf file.
-
export_images
(**kwargs)¶
-
legend_parameter
(name: str) → honeybee_vtk.legend_parameter.LegendParameter[source]¶ Get a legend parameter object by name.
- Parameters
name – A string for the name of the legend parameters you are looking for.
- Returns
A legend parameter object.
-
update_scene
() → None[source]¶ Update the scene.
This method will use the latest cameras, actors, and visible legend parameters to create assistant object.
-
property
actors
¶ Actors in the scene.
-
property
assistants
¶ A list of honeybee-vtk assistants working in the scene.
-
property
background_color
¶ background_color for the scene.
-
property
cameras
¶ A list of honeybee-vtk cameras setup in the scene.
-
property
legend_parameters
¶ Legends in the scene that can be added to the images.
-
property
text_actor
¶ TextActor object in the scene.