BoundingBox2D#

class ansys.geometry.core.math.bbox.BoundingBox2D(x_min: ansys.geometry.core.typing.Real = sys.float_info.max, x_max: ansys.geometry.core.typing.Real = sys.float_info.min, y_min: ansys.geometry.core.typing.Real = sys.float_info.max, y_max: ansys.geometry.core.typing.Real = sys.float_info.min)#

Maintains the X and Y dimensions.

Parameters:
x_minReal

Minimum value for the x-dimensional bounds.

x_maxReal

Maximum value for the x-dimensional bounds.

y_minReal

Minimum value for the y-dimensional bounds.

y_maxReal

Maximum value for the y-dimensional bounds.

Overview#

add_point

Extend the ranges of the bounding box to include a point.

add_point_components

Extend the ranges of the bounding box to include the X and Y values.

add_points

Extend the ranges of the bounding box to include given points.

contains_point

Evaluate whether a point lies within the X and Y range bounds.

contains_point_components

Check if point components are within the X and Y range bounds.

x_min

Minimum value of X-dimensional bounds.

x_max

Maximum value of the X-dimensional bounds.

y_min

Minimum value of Y-dimensional bounds.

y_max

Maximum value of Y-dimensional bounds.

__eq__

Equals operator for the BoundingBox2D class.

__ne__

Not equals operator for the BoundingBox2D class.

Import detail#

from ansys.geometry.core.math.bbox import BoundingBox2D

Property detail#

property BoundingBox2D.x_min: ansys.geometry.core.typing.Real#

Minimum value of X-dimensional bounds.

Returns:
Real

Minimum value of the X-dimensional bounds.

property BoundingBox2D.x_max: ansys.geometry.core.typing.Real#

Maximum value of the X-dimensional bounds.

Returns:
Real

Maximum value of the X-dimensional bounds.

property BoundingBox2D.y_min: ansys.geometry.core.typing.Real#

Minimum value of Y-dimensional bounds.

Returns:
Real

Minimum value of Y-dimensional bounds.

property BoundingBox2D.y_max: ansys.geometry.core.typing.Real#

Maximum value of Y-dimensional bounds.

Returns:
Real

Maximum value of Y-dimensional bounds.

Method detail#

BoundingBox2D.add_point(point: ansys.geometry.core.math.point.Point2D) None#

Extend the ranges of the bounding box to include a point.

Parameters:
pointPoint2D

Point to include within the bounds.

Notes

This method is only applicable if the point components are outside the current bounds.

BoundingBox2D.add_point_components(x: ansys.geometry.core.typing.Real, y: ansys.geometry.core.typing.Real) None#

Extend the ranges of the bounding box to include the X and Y values.

Parameters:
xReal

Point X component to include within the bounds.

yReal

Point Y component to include within the bounds.

Notes

This method is only applicable if the point components are outside the current bounds.

BoundingBox2D.add_points(points: list[ansys.geometry.core.math.point.Point2D]) None#

Extend the ranges of the bounding box to include given points.

Parameters:
pointslist[Point2D]

List of points to include within the bounds.

BoundingBox2D.contains_point(point: ansys.geometry.core.math.point.Point2D) bool#

Evaluate whether a point lies within the X and Y range bounds.

Parameters:
pointPoint2D

Point to compare against the bounds.

Returns:
bool

True if the point is contained in the bounding box. Otherwise, False.

BoundingBox2D.contains_point_components(x: ansys.geometry.core.typing.Real, y: ansys.geometry.core.typing.Real) bool#

Check if point components are within the X and Y range bounds.

Parameters:
xReal

Point X component to compare against the bounds.

yReal

Point Y component to compare against the bounds.

Returns:
bool

True if the components are contained in the bounding box. Otherwise, False.

BoundingBox2D.__eq__(other: BoundingBox2D) bool#

Equals operator for the BoundingBox2D class.

BoundingBox2D.__ne__(other: BoundingBox2D) bool#

Not equals operator for the BoundingBox2D class.