treble_tsdk.geometry.geometry_definition

Classes

class treble_tsdk.geometry.geometry_definition.GeometryDefinition
__init__(room_geo: str | ModelObj | GeometryLibraryObj, layer_as_component: dict[str, str] | None = None)

Create a geometry definition object

Parameters:
  • room_geo (str | ModelObj | GeometryLibraryObj) – Input the room geometry

  • layer_as_component (dict[str, str]) – In case parts of the geometry should be separated into components, supply the component name and geometry name, defaults to None

add_geometry_component(name: str, geometry_component: GeometryComponent, transform: Transform3d, snap_layer_name: str | None = None)
clear_geometry_components()

Removes all geometry components from the room.

get_bounding_box() BoundingBox | None

Get the bounding box of the model. :returns BoundingBox | None: Bounding box of the model or None if unable to get bounding box.

get_geometry_component_transform(name: str)
get_min_distance_to_layer(point: Point3d, layer_names: list[str] | str) float | None

Calculate the minimum distance from a point to a layer in layer_names in meters.

Parameters:
  • point (Point3d) – The point to measure distance from

  • layer_names (list[str]) – The names of the layers to measure distance to. Supports wildcard matching using fnmatch.

Return float | None:

The minimum distance from the point to the layer in meters, None if the layer has no geometry

has_line_of_sight(point_a: Point3d, point_b: Point3d) bool

Check if two points have line-of-sight to each other within the model.

Parameters:
  • point_a (Point3d) – The first point

  • point_b (Point3d) – The second point

Return bool:

True if the points have line-of-sight (no mesh occlusion), False otherwise

move_geometry_component(name: str, translation: Point3d | Vector3d)
plot(view_2d: View2d | None = None, show_bounding_boxes: bool = False)
populate_with_geometry_components(components: list[GeometryComponentPlacement], selection_algorithm: ComponentSelectionAlgorithm = ComponentSelectionAlgorithm.random)
remove_geometry_component(name: str)
set_geometry_component_rotation(name: str, rotation: Rotation)
set_geometry_component_transform(name: str, transform: Transform3d)