|
AGX Dynamics 2.41.1.2
|
Utility class to create a convex hull in a plane given point cloud. More...
#include <ConvexHull2D.h>
Classes | |
| struct | Point |
| Point in hull containing the point projected onto the plane and the original point. More... | |
Public Types | |
| using | const_iterator = HullContainer::const_iterator |
| using | Curve = PointCurve< Point > |
| using | CurveSegment = PointCurve< Point >::Segment |
| using | HullContainer = agx::VectorPOD< Point > |
Public Member Functions | |
| ConvexHull2D () | |
| Default constructor. | |
| ConvexHull2D (const agx::Vec3Vector &points, const agx::Plane &plane) | |
| Construct given point cloud and a plane. | |
| ConvexHull2D (const agx::Vec3Vector &points, const agx::Plane &plane, agx::UInt numSubQuadrangles) | |
| Construct given point cloud, plane and number of sub-quadrangles. | |
| Curve | asCurve (agx::Bool closed=true) const |
| Current hull as a curve object. | |
| const Point & | back () const |
| const_iterator | begin () const |
| agx::Real | calculateArea () const |
| Calculates the area of the hull - if the hull is present. | |
| agx::Real | calculatePerimeter () const |
| Computes the perimeter of the hull - if the hull is present. | |
| const HullContainer & | computeHullJarvisMarch (const agx::Vec3Vector &points, const agx::Plane &plane) |
| Computes the convex hull in the given plane using 2D gift wrapping algorithm - Jarvis march. | |
| const HullContainer & | computeHullQuadrangles (const agx::Vec3Vector &points, const agx::Plane &plane, agx::UInt numSubQuadrangles) |
| Computes the convex hull in the given plane using a set of quadrangles. | |
| const_iterator | end () const |
| const Point & | front () const |
| const HullContainer & | getHull () const |
| const Point & | operator[] (agx::UInt index) const |
| Access hull points of given index. | |
| agx::UInt | size () const |
Utility class to create a convex hull in a plane given point cloud.
Definition at line 29 of file ConvexHull2D.h.
Definition at line 45 of file ConvexHull2D.h.
| using agxUtil::ConvexHull2D::Curve = PointCurve<Point> |
Definition at line 46 of file ConvexHull2D.h.
| using agxUtil::ConvexHull2D::CurveSegment = PointCurve<Point>::Segment |
Definition at line 47 of file ConvexHull2D.h.
Definition at line 44 of file ConvexHull2D.h.
| agxUtil::ConvexHull2D::ConvexHull2D | ( | ) |
Default constructor.
| agxUtil::ConvexHull2D::ConvexHull2D | ( | const agx::Vec3Vector & | points, |
| const agx::Plane & | plane | ||
| ) |
Construct given point cloud and a plane.
The hull will be calculated during construction using the Jarvis march algorithm.
| points | - original point cloud |
| plane | - plane to project point cloud onto |
| agxUtil::ConvexHull2D::ConvexHull2D | ( | const agx::Vec3Vector & | points, |
| const agx::Plane & | plane, | ||
| agx::UInt | numSubQuadrangles | ||
| ) |
Construct given point cloud, plane and number of sub-quadrangles.
The hull will be calculated during construction using the Quadrangles algorithm.
| 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) |
Current hull as a curve object.
| closed | - true if the curve should be closed, i.e., first point == last point |
|
inline |
Definition at line 164 of file ConvexHull2D.h.
References agx::VectorPOD< T, Allocator >::back().
|
inline |
Definition at line 174 of file ConvexHull2D.h.
References agx::VectorPOD< T, Allocator >::begin().
| 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.
| 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.
| const HullContainer & agxUtil::ConvexHull2D::computeHullJarvisMarch | ( | const agx::Vec3Vector & | points, |
| const agx::Plane & | plane | ||
| ) |
Computes the convex hull in the given plane using 2D gift wrapping algorithm - Jarvis march.
| points | - original point cloud |
| plane | - plane to project point cloud onto |
| const HullContainer & agxUtil::ConvexHull2D::computeHullQuadrangles | ( | const agx::Vec3Vector & | points, |
| const agx::Plane & | plane, | ||
| agx::UInt | numSubQuadrangles | ||
| ) |
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.
| 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) |
|
inline |
Definition at line 179 of file ConvexHull2D.h.
References agx::VectorPOD< T, Allocator >::end().
|
inline |
Definition at line 159 of file ConvexHull2D.h.
References agx::VectorPOD< T, Allocator >::front().
| const HullContainer & agxUtil::ConvexHull2D::getHull | ( | ) | const |
|
inline |
Access hull points of given index.
No bounds checks make sure index < size().
| index | - hull point index |
index in the hull Definition at line 154 of file ConvexHull2D.h.
|
inline |
Definition at line 169 of file ConvexHull2D.h.
References agx::Container::size().