You are here: Start » AVL.NET » AVL.PointsBoundingRectangle Method

AVL.PointsBoundingRectangle Method

Computes the smallest rectangle containing an array of points.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

public static void PointsBoundingRectangle(
	AvlNet.Point2D[] inPoints,
	AvlNet.BoundingRectangleFeature inBoundingRectangleFeature,
	float inReferenceAngle,
	AvlNet.RectangleOrientation inRectangleOrientation,
	out AvlNet.Rectangle2D outBoundingRectangle,
	out AvlNet.Point2D outCenter,
	out float outLongSide,
	out float outShortSide
)

Parameters

Name Type Range Default Description
inPointsAvlNet.Point2DInput array of points.
inBoundingRectangleFeatureAvlNet.BoundingRectangleFeatureMinimalAreaDetermines what kind of bounding rectangle will be computed. Default value: MinimalArea.
inReferenceAnglefloat0.0fThe middle angle of the valid range of the output rectangle's angle. Default value: 0.0f.
inRectangleOrientationAvlNet.RectangleOrientationHorizontalOrientation of the output rectangle. Default value: Horizontal.
outBoundingRectangleAvlNet.Rectangle2DSmallest bounding rectangle of the input points.
outCenterAvlNet.Point2DCenter of the bounding rectangle
outLongSidefloatLength of the bounding rectangle long side
outShortSidefloatLength of the bounding rectangle short side

Description

The filter computes a rectangle with the smallest possible selected feature that contains all given points. The angle of the resulting rectangle is then normalized as in the NormalizeRectangleOrientation filter.

Examples

The resulting outBoundingRectangle drawn with the input points and with inRectangleOrientation set on Horizontal

Errors

Error type Description
DomainError No points on input in PointsBoundingRectangle.
DomainError Incorrect BoundingRectangleFeature in PointsBoundingRectangle.

See also