Navigation
API > API/Runtime > API/Runtime/GeometryCore
Description
Use the rotating calipers algorithm to find a best-fit oriented bounding box of a simple polygon. Note the polygon should not be self-intersecting. O(n) in the number of points.
| Name | UE::Geometry::FitOrientedBox2SimplePolygon |
| Type | function |
| Header File | /Engine/Source/Runtime/GeometryCore/Public/CompGeom/FitOrientedBox2.h |
| Include Path | #include "CompGeom/FitOrientedBox2.h" |
namespace UE
{
namespace Geometry
{
template<typename RealType>
TOrientedBox2 < RealType > UE::Geometry::FitOrientedBox2SimplePolygon
(
TArrayView < const TVector2 < RealType > > Polygon,
EBox2FitCriteria FitMethod
)
}
}
A best-fit TOrientedBox2 that contains the points
Parameters
| Name | Remarks |
|---|---|
| Polygon | The vertices of the simple polygon to fit |
| FitMethod | What criteria to optimize |