honeybee_vtk.model module

A VTK representation of HBModel.

class honeybee_vtk.model.Model(model: honeybee.model.Model, load_grids: honeybee_vtk.vtkjs.schema.SensorGridOptions = SensorGridOptions.Ignore)[source]

Bases: object

A honeybee-vtk model.

The model objects are accessible based on their types:

  • apertures

  • doors

  • shades

  • walls

  • floors

  • roof_ceilings

  • air_boundaries

  • sensor_grids

You can control the style for each type separately.

classmethod from_hbjson(hbjson: str, load_grids: honeybee_vtk.vtkjs.schema.SensorGridOptions = SensorGridOptions.Ignore) honeybee_vtk.model.Model[source]

Translate hbjson to a honeybee-vtk model.

Parameters
  • model – A text string representing the path to the hbjson file.

  • load_grids – A SensorGridOptions object. Defaults to SensorGridOptions.Ignore which will ignore the grids in hbjson and will not load them in the honeybee-vtk model.

Returns

A honeybee-vtk model object.

static get_default_color(face_type: face_types) Color[source]

Get the default color based of face type.

Use these colors to generate visualizations that are familiar for Ladybug Tools users. User can overwrite these colors as needed. This method converts decimal RGBA to integer RGBA values.

get_modeldataset(dataset: honeybee_vtk.types.DataSetNames) honeybee_vtk.types.ModelDataSet[source]

Get a ModelDataSet object from a model.

Parameters

dataset – A DataSetNames object.

Returns

A ModelDataSet object.

static separate_by_type(data: List[honeybee_vtk.types.PolyData]) Dict[source]

Separate PolyData objects by type.

to_files(folder: str, name: str, writer: honeybee_vtk.types.VTKWriters) str[source]

Write a .zip of VTK/VTP files.

Parameters
  • name – A text string for the name of the .zip file to be written. If no text string is provided, the name of the HBJSON file will be used as a file name for the .zip file.

  • folder – File path to the output folder. The file will be written to the current folder if not provided.

  • writer – A VTkWriters object.

Returns

A text string containing the path to the .zip file with VTK/VTP files.

to_html(folder: str = '.', name: Optional[str] = None, show: bool = False) str[source]

Write an HTML file.

Write your honeybee-vtk model to an HTML file.

Parameters
  • folder – A valid text string representing the location of folder where you’d want to write the HTML file. Defaults to current working directory.

  • name – Name for the HTML file. File name will be Model.html if not provided.

  • show – A boolean value. If set to True, the HTML file will be opened in the default browser. Defaults to False

Returns

A text string representing the file path to the HTML file.

to_vtkjs(folder: str = '.', name: Optional[str] = None) str[source]

Write a vtkjs file.

Write your honeybee-vtk model to a vtkjs file that you can open in Paraview-Glance.

Parameters
  • folder – A valid text string representing the location of folder where you’d want to write the vtkjs file. Defaults to current working directory.

  • name – Name for the vtkjs file. File name will be Model.vtkjs if not provided.

Returns

A text string representing the file path to the vtkjs file.

update_display_mode(value: honeybee_vtk.vtkjs.schema.DisplayMode) None[source]

Change display mode for all the object types in the model.

Sensor grids display model will not be affected. For changing the display model for a single object type, change the display_mode property separately.

model.sensor_grids.display_mode = DisplayMode.Wireframe
property air_boundaries: honeybee_vtk.types.ModelDataSet

Air boundaries.

property apertures: honeybee_vtk.types.ModelDataSet

Model aperture.

property cameras

List of Camera objects attached to this Model object.

property doors: honeybee_vtk.types.ModelDataSet

Model doors.

property floors: honeybee_vtk.types.ModelDataSet

Model floors.

property roof_ceilings: honeybee_vtk.types.ModelDataSet

Roof and ceilings.

property sensor_grids: honeybee_vtk.types.ModelDataSet

Sensor grids.

property shades: honeybee_vtk.types.ModelDataSet

Model shades.

property walls: honeybee_vtk.types.ModelDataSet

Model walls.