Computes bounding rectangles for 2D geometry. More...
Static Public Member Functions | |
| static Geom::Box2d | ComputeOriented (const Drawing::CurveSet &theCurves, const BoundingBox2dParameters &theParameters={}) |
| Computes an oriented bounding rectangle for the specified 2D curves. | |
| static Geom::Box2d | ComputeOriented (std::vector< Geom::Point2d > theCurves, const BoundingBox2dParameters &theParameters={}) |
Computes bounding rectangles for 2D geometry.
The class provides algorithms for computing a rectangle that encloses the specified 2D geometry.
An oriented bounding rectangle is allowed to have an arbitrary orientation. Its orientation is selected to optimize the rectangle according to the criterion specified in BoundingBox2dParameters, such as minimum area or minimum perimeter.
For a set of points, the rectangle is computed directly from the input points. For a CurveSet, the curves are first discretized using the discretization tolerance specified in BoundingBox2dParameters, and the resulting points are used for the rectangle computation.
The returned Geom::Box2d contains the rectangle position, orientation, width, and height.
|
static |
Computes an oriented bounding rectangle for the specified 2D curves.
The curves are discretized using the tolerance specified in theParameters. The rectangle orientation is selected according to the optimization criterion specified in theParameters.