RobWorkProject  22.2.21-
Public Member Functions | List of all members
QHullND< N > Class Template Reference

calculates the convex hull of a set of 3d points. More...

#include <QHullND.hpp>

Inherits ConvexHullND< N >.

Public Member Functions

 QHullND ()
 constructor
 
virtual ~QHullND ()
 destructor
 
void rebuild (const std::vector< rw::math::VectorND< N > > &vertices)
 rebuilts the hull More...
 
virtual bool isInside (const rw::math::VectorND< N > &vertex)
 Check if a point is inside the hull. More...
 
virtual double getMinDistOutside (const rw::math::VectorND< N > &vertex)
 Calculates a distance to the hull. The distance to the vertex is greater or equal to the result. More...
 
virtual double getMinDistInside (const rw::math::VectorND< N > &vertex)
 Calculates the minimum distance to the hull. More...
 
virtual double getAvgDistInside (const rw::math::VectorND< N > &vertex)
 Calculate average distance from point inside the convex hull to its walls. More...
 
virtual rw::math::VectorND< N > getCentroid ()
 Return centroid of the convex hull. More...
 
virtual rw::math::VectorND< N > getClosestPoint (const rw::math::VectorND< N > &vertex)
 Returns the point on the convex hull closest to the vertex . More...
 
virtual double getVolume () const
 Calculates the volume of the hull. More...
 
const std::vector< rw::math::VectorND< N > > & getHullVertices ()
 Returns the list hull vertices. More...
 
const std::vector< int > & getFaceIndices ()
 Returns the list with face indices. More...
 
const std::vector< rw::math::VectorND< N > > & getFaceNormals ()
 Returns the face normals. More...
 
const std::vector< double > & getFaceOffsets ()
 Returns the offsets (distance from origin to surface in direction of the normal) of the faces. More...
 

Additional Inherited Members

- Public Types inherited from ConvexHullND< N >
typedef rw::core::Ptr< ConvexHullND< N > > Ptr
 smart pointer type of this class
 

Detailed Description

template<std::size_t N>
class rw::geometry::QHullND< N >

calculates the convex hull of a set of 3d points.

The GirftWrap convex hull algorithm is used, hence the class name.

Note
It is important that there are not multiple vertices at the same coordinates. Filter these away before using this convex hull calculation.

Member Function Documentation

◆ getAvgDistInside()

virtual double getAvgDistInside ( const rw::math::VectorND< N > &  vertex)
inlinevirtual

Calculate average distance from point inside the convex hull to its walls.

Each distance is weighted according to the wall's volume.'

Implements ConvexHullND< N >.

◆ getCentroid()

virtual rw::math::VectorND< N > getCentroid ( )
inlinevirtual

Return centroid of the convex hull.

Centroid is calculated as an average of face centroids weighted by face area.

Implements ConvexHullND< N >.

◆ getClosestPoint()

virtual rw::math::VectorND< N > getClosestPoint ( const rw::math::VectorND< N > &  vertex)
inlinevirtual

Returns the point on the convex hull closest to the vertex .

Parameters
vertex[in] the vertex.
Returns
the closest point.

Implements ConvexHullND< N >.

◆ getFaceIndices()

const std::vector< int >& getFaceIndices ( )
inline

Returns the list with face indices.

Returns
Reference to the internal vector with face normals

◆ getFaceNormals()

const std::vector< rw::math::VectorND< N > >& getFaceNormals ( )
inline

Returns the face normals.

Returns
Reference to the internal vector with face normals

◆ getFaceOffsets()

const std::vector< double >& getFaceOffsets ( )
inline

Returns the offsets (distance from origin to surface in direction of the normal) of the faces.

Returns
Reference to the internal list face offsets

◆ getHullVertices()

const std::vector< rw::math::VectorND< N > >& getHullVertices ( )
inline

Returns the list hull vertices.

Returns
Reference to the internal vector with hull vertices

◆ getMinDistInside()

virtual double getMinDistInside ( const rw::math::VectorND< N > &  vertex)
inlinevirtual

Calculates the minimum distance to the hull.

Parameters
vertex[in] vertex to calculate distance for.
Returns
the minimum distance if vertex is inside the hull (as a positive value). Currently, the maximum distance is returned if vertex is outside the hull (as a negative value). This is subject to change, so do not rely on this behaviour.

Implements ConvexHullND< N >.

◆ getMinDistOutside()

virtual double getMinDistOutside ( const rw::math::VectorND< N > &  vertex)
inlinevirtual

Calculates a distance to the hull. The distance to the vertex is greater or equal to the result.

Parameters
vertex[in] vertex to calculate minimum distance for.
Returns
a distance <= the actual distancte to the hull if vertex is outside, otherwise zero is returned.

Implements ConvexHullND< N >.

◆ getVolume()

virtual double getVolume ( ) const
inlinevirtual

Calculates the volume of the hull.

Returns
The volume of the QHull.

◆ isInside()

virtual bool isInside ( const rw::math::VectorND< N > &  vertex)
inlinevirtual

Check if a point is inside the hull.

Parameters
vertex[in] the vertex to check.
Returns
true if vertex lies on hull or inside, false otherwise.

Implements ConvexHullND< N >.

◆ rebuild()

void rebuild ( const std::vector< rw::math::VectorND< N > > &  vertices)
inlinevirtual

rebuilts the hull

Parameters
vertices

Implements ConvexHullND< N >.


The documentation for this class was generated from the following file: