RegionBounds

March 7, 2022 ยท View on GitHub

from scene_data.region_bounds import RegionBounds

Data for the bounds of a region in a scene. In an interior scene, this usually corresponds to a room.


Fields

  • region_id The ID of the region.

  • center The center of the region.

  • bounds The bounds of the region.

  • x_min Minimum x positional coordinate of the room.

  • y_min Minimum y positional coordinate of the room.

  • z_min Minimum z positional coordinate of the room.

  • x_max Maximum x positional coordinate of the room.

  • y_max Maximum y positional coordinate of the room.

  • z_max Maximum z positional coordinate of the room.


Functions

__init__

RegionBounds(region_id, center, bounds)

ParameterTypeDefaultDescription
region_idintThe ID of the region.
centerTuple[float, float, float]The center of the region.
boundsTuple[float, float, float]The bounds of the region.

is_inside

self.is_inside(x, z)

ParameterTypeDefaultDescription
xfloatThe x coordinate.
zfloatThe z coordinate.

Returns: True if position (x, z) is in the scene.

get_length

self.get_length(side)

ParameterTypeDefaultDescription
sideCardinalDirectionA side of the region as a CardinalDirection.

Returns: The length of the side.

get_longer_sides

self.get_longer_sides()

Returns: Tuple: A list of the longer sides as CardinalDirection values, the length of the sides.

get_shorter_sides

self.get_shorter_sides()

Returns: Tuple: A list of the shorter sides as CardinalDirection values, the length of the sides.

get_from_scene_regions

self.get_from_scene_regions(scene_regions, i)

ParameterTypeDefaultDescription
scene_regionsSceneRegionsThe scene regions output data.
iintThe index of this scene in env.get_num()

Returns: RegionBounds.