ladybug_geometry.bounding module¶
Utility functions for computing bounding boxes and extents around geometry.
- ladybug_geometry.bounding.bounding_box(geometries, axis_angle=0)[source]¶
Get the min and max of an oriented bounding box around 3D geometry.
- Parameters:
geometries – An array of 3D geometry objects. Note that all objects must have a min and max property.
axis_angle – The counter-clockwise rotation angle in radians in the XY plane to represent the orientation of the bounding box extents. (Default: 0).
- Returns:
A tuple with two Point3D objects representing the min point and max point of the bounding box respectively.
- ladybug_geometry.bounding.bounding_box_extents(geometries, axis_angle=0)[source]¶
Get the width, length and height of an oriented bounding box around 3D geometry.
- Parameters:
geometries – An array of 3D geometry objects. Note that all objects must have a min and max property.
axis_angle – The counter-clockwise rotation angle in radians in the XY plane to represent the orientation of the bounding box extents. (Default: 0).
- Returns:
A tuple with 3 values corresponding to the width, length and height of the bounding box.
- ladybug_geometry.bounding.bounding_domain_x(geometries)[source]¶
Get minimum and maximum X coordinates of multiple geometries.
- Parameters:
geometries – An array of any ladybug_geometry objects for which the extents of the X domain will be computed. Note that all objects must have a min and max property.
- Returns:
A tuple with the min and the max X coordinates around the geometry.
- ladybug_geometry.bounding.bounding_domain_y(geometries)[source]¶
Get minimum and maximum Y coordinates of multiple geometries.
- Parameters:
geometries – An array of any ladybug_geometry objects for which the extents of the Y domain will be computed. Note that all objects must have a min and max property.
- Returns:
A tuple with the min and the max Y coordinates around the geometry.
- ladybug_geometry.bounding.bounding_domain_z(geometries)[source]¶
Get minimum and maximum Z coordinates of multiple geometries.
- Parameters:
geometries – An array of any 3D ladybug_geometry objects for which the extents of the Z domain will be computed. Note that all objects must have a min and max property and they cannot be 2D objects.
- Returns:
A tuple with the min and the max Z coordinates around the geometry.
- ladybug_geometry.bounding.bounding_domain_z_2d_safe(geometries)[source]¶
Get minimum and maximum Z coordinates in a manner that is safe for 2D geometries.
- Parameters:
geometries – An array of any ladybug_geometry objects for which the extents of the Z domain will be computed. Any 2D objects within this list will be assumed to have a Z-value of zero.
- Returns:
A tuple with the min and the max Z coordinates around the geometry.
- ladybug_geometry.bounding.bounding_rectangle(geometries, axis_angle=0)[source]¶
Get the min and max of an oriented bounding rectangle around 2D or 3D geometry.
- Parameters:
geometries – An array of 2D or 3D geometry objects. Note that all objects must have a min and max property.
axis_angle – The counter-clockwise rotation angle in radians in the XY plane to represent the orientation of the bounding rectangle extents. (Default: 0).
- Returns:
A tuple with two Point2D objects representing the min point and max point of the bounding rectangle respectively.
- ladybug_geometry.bounding.bounding_rectangle_extents(geometries, axis_angle=0)[source]¶
Get the width and length of an oriented bounding rectangle around 2D or 3D geometry.
- Parameters:
geometries – An array of 2D or 3D geometry objects. Note that all objects must have a min and max property.
axis_angle – The counter-clockwise rotation angle in radians in the XY plane to represent the orientation of the bounding rectangle extents. (Default: 0).
- Returns:
A tuple with 2 values corresponding to the width and length of the bounding rectangle.
- ladybug_geometry.bounding.min_area_bounding_rectangle(geometries, angle_tolerance=0.017453292519943295)[source]¶
Get the four Point2Ds for the bounding rectangle with the smallest area around points.
- Parameters:
geometries – An array of 2D or 3D geometry objects.
angle_tolerance – The smallest angle in radians that is meaningful for the bounding rectangle calculation. (Default: math.pi/180).
- Returns:
A tuple with 4 points corresponding to the corners of the smallest area bounding rectangle. The first two points will always have the longer dimension of the rectangle.
- ladybug_geometry.bounding.overlapping_bounding_boxes(geometry_1, geometry_2, distance)[source]¶
Check if the bounding boxes around two geometries overlap within a distance.
- Parameters:
geometry_1 – The first geometry to check.
geometry_2 – The second geometry to check.
distance – The maximum distance at which the geometries are considered overlapping.
- Returns:
True if the geometries overlap. False if they do not.
- ladybug_geometry.bounding.overlapping_bounding_rect(geometry_1, geometry_2, distance)[source]¶
Check if the bounding rectangles of two geometries overlap within a tolerance.
- Parameters:
geometry_1 – The first geometry to check.
geometry_2 – The second geometry to check.
distance – The maximum distance at which the geometries are considered overlapping.
- Returns:
True if the geometries overlap. False if they do not.