PointsBoundingRectangle


Computes the smallest rectangle containing an array of points.

Syntax

C++
Python
 
def PointsBoundingRectangle(
	inPoints: list[Point2D],
	/,
	*,
	inBoundingRectangleFeature: BoundingRectangleFeature = BoundingRectangleFeature.MinimalArea,
	inReferenceAngle: float = 0.0,
	inRectangleOrientation: RectangleOrientation = RectangleOrientation.Horizontal,
	outCenter: Point2D | None = None
)
-> (
	outBoundingRectangle: Rectangle2D,
	outLongSide: float,
	outShortSide: float
)

Parameters

Name Type Default Description
Input value inPoints list[Point2D] Input array of points
Input value inBoundingRectangleFeature BoundingRectangleFeature BoundingRectangleFeature.MinimalArea Determines what kind of bounding rectangle will be computed
Input value inReferenceAngle float 0.0 The middle angle of the valid range of the output rectangle's angle
Input value inRectangleOrientation RectangleOrientation RectangleOrientation.Horizontal Orientation of the output rectangle
Output value outBoundingRectangle Rectangle2D Smallest bounding rectangle of the input points
Output value outCenter Point2D | None None Center of the bounding rectangle
Output value outLongSide float Length of the bounding rectangle long side
Output value outShortSide float Length of the bounding rectangle short side