Class ConvexBase
Defined in File geometric_shapes.h
Nested Relationships
Nested Types
Inheritance Relationships
Base Type
public coal::ShapeBase
(Class ShapeBase)
Derived Types
public boost::serialization::internal::ConvexBaseAccessor
(Struct ConvexBaseAccessor)public coal::Convex< PolygonT >
(Template Class Convex)
Class Documentation
-
class ConvexBase : public coal::ShapeBase
Base for convex polytope.
Note
Inherited classes are responsible for filling ConvexBase::neighbors;
Subclassed by boost::serialization::internal::ConvexBaseAccessor, coal::Convex< PolygonT >
Public Functions
-
virtual ~ConvexBase()
-
inline virtual ConvexBase *clone() const
Clone (deep copy). This method is consistent with BVHModel
clone
method. The copy constructor is called, which duplicates the data.
Public Members
-
unsigned int num_points
-
std::shared_ptr<std::vector<double>> offsets
An array of the offsets to the normals of the polygon. Note: there are as many offsets as normals.
-
unsigned int num_normals_and_offsets
-
std::shared_ptr<std::vector<Neighbors>> neighbors
Neighbors of each vertex. It is an array of size num_points. For each vertex, it contains the number of neighbors and a list of indices pointing to them.
-
Vec3s center
center of the convex polytope, this is used for collision: center is guaranteed in the internal of the polytope (as it is convex)
-
SupportWarmStartPolytope support_warm_starts
Support warm start polytopes.
Public Static Functions
Build a convex hull based on Qhull library and store the vertices and optionally the triangles.
Note
Coal must have been compiled with option
COAL_HAS_QHULL
set toON
.- Parameters:
points, num_points – the points whose convex hull should be computed.
keepTriangles – if
true
, returns a Convex<Triangle> object which contains the triangle of the shape.qhullCommand – the command sent to qhull.
if
keepTriangles
istrue
, this parameter should include “Qt”. IfNULL
, “Qt” is passed to Qhull.if
keepTriangles
isfalse
, an empty string is passed to Qhull.
- static COAL_DEPRECATED ConvexBase * convexHull (const Vec3s *points, unsigned int num_points, bool keepTriangles, const char *qhullCommand=NULL)
Public Static Attributes
-
static constexpr size_t num_vertices_large_convex_threshold = 32
Above this threshold, the convex polytope is considered large. This influcences the way the support function is computed.
-
static constexpr size_t num_support_warm_starts = 14
Number of support warm starts.
Protected Functions
-
inline ConvexBase()
Construct an uninitialized convex object Initialization is done with ConvexBase::initialize.
Initialize the points of the convex shape This also initializes the ConvexBase::center.
- Parameters:
ownStorage – weither the ConvexBase owns the data.
points_ – list of 3D points ///
num_points_ – number of 3D points
Set the points of the convex shape.
- Parameters:
ownStorage – weither the ConvexBase owns the data.
points_ – list of 3D points ///
num_points_ – number of 3D points
-
ConvexBase(const ConvexBase &other)
Copy constructor Only the list of neighbors is copied.
-
void buildSupportWarmStart()
Build the support points warm starts.
Protected Attributes
-
std::shared_ptr<std::vector<unsigned int>> nneighbors_
Array of indices of the neighbors of each vertex. Since we don’t know a priori the number of neighbors of each vertex, we store the indices of the neighbors in a single array. The
neighbors
attribute, an array ofNeighbors
, is used to point each vertex to the right indices in thenneighbors_
array.
-
struct Neighbors
-
struct SupportWarmStartPolytope
The support warm start polytope contains certain points of
this
which are support points in specific directions of space. This struct is used to warm start the support function computation for large meshes (num_points
> 32).
-
virtual ~ConvexBase()