Utility class to create a convex hull in a plane given point cloud.
More...
#include <ConvexHull2D.h>
|
| struct | Point |
| | Point in hull containing the point projected onto the plane and the original point. More...
|
| |
Utility class to create a convex hull in a plane given point cloud.
Definition at line 29 of file ConvexHull2D.h.
◆ const_iterator
◆ Curve
◆ CurveSegment
◆ HullContainer
◆ ConvexHull2D() [1/3]
| agxUtil::ConvexHull2D::ConvexHull2D |
( |
| ) |
|
◆ ConvexHull2D() [2/3]
Construct given point cloud and a plane.
The hull will be calculated during construction using the Jarvis march algorithm.
- Parameters
-
| points | - original point cloud |
| plane | - plane to project point cloud onto |
◆ ConvexHull2D() [3/3]
Construct given point cloud, plane and number of sub-quadrangles.
The hull will be calculated during construction using the Quadrangles algorithm.
- Parameters
-
| points | - original point cloud |
| plane | - plane to project point cloud onto |
| numSubQuadrangles | - number of sub quadrangles defining the accuracy of this algorithm (3 is very low and 100 is large and probably accurate) |
◆ asCurve()
Current hull as a curve object.
- Parameters
-
| closed | - true if the curve should be closed, i.e., first point == last point |
- Returns
- current hull points as a curve object
◆ back()
- Returns
- last element of the hull assuming the hull isn't empty
Definition at line 164 of file ConvexHull2D.h.
◆ begin()
◆ calculateArea()
| agx::Real agxUtil::ConvexHull2D::calculateArea |
( |
| ) |
const |
Calculates the area of the hull - if the hull is present.
If the hull is empty, i.e., number of points < 2, the area is 0.
- Returns
- area of the hull in the plane
◆ calculatePerimeter()
| agx::Real agxUtil::ConvexHull2D::calculatePerimeter |
( |
| ) |
const |
Computes the perimeter of the hull - if the hull is present.
If the hull is empty, i.e., number of points < 2, the perimeter is 0.
- Returns
- the perimeter of the hull in the plane
◆ computeHullJarvisMarch()
Computes the convex hull in the given plane using 2D gift wrapping algorithm - Jarvis march.
- Parameters
-
| points | - original point cloud |
| plane | - plane to project point cloud onto |
- Returns
- hull points if successful - otherwise an empty array
◆ computeHullQuadrangles()
Computes the convex hull in the given plane using a set of quadrangles.
This approach can be much faster than the Jarvis march but points could be missed if numSubQuadrangles is too low. The lower number of sub-quadrangles the quicker this method will find a hull.
- Parameters
-
| points | - original point cloud |
| plane | - plane to project point cloud onto |
| numSubQuadrangles | - number of sub quadrangles defining the accuracy of this algorithm (3 is very low and 100 is large and probably accurate) |
- Returns
- hull points if successful - otherwise an empty array
◆ end()
◆ front()
- Returns
- first element of the hull assuming the hull isn't empty
Definition at line 159 of file ConvexHull2D.h.
◆ getHull()
- Returns
- the hull (empty array if not created)
◆ operator[]()
Access hull points of given index.
No bounds checks make sure index < size().
- Parameters
-
- Returns
- point with index
index in the hull
Definition at line 154 of file ConvexHull2D.h.
◆ size()
| agx::UInt agxUtil::ConvexHull2D::size |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: