38 #ifndef COAL_GEOMETRIC_SHAPES_H
39 #define COAL_GEOMETRIC_SHAPES_H
44 #include <boost/math/constants/constants.hpp>
65 m_swept_sphere_radius(other.m_swept_sphere_radius) {}
79 std::invalid_argument);
81 this->m_swept_sphere_radius = radius;
116 :
ShapeBase(other), a(other.a), b(other.b), c(other.c) {}
152 if (other_ptr ==
nullptr)
return false;
155 return a == other.
a && b == other.
b && c == other.
c &&
160 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
167 :
ShapeBase(), halfSide(x / 2, y / 2, z / 2) {}
174 if (
this == &other)
return *
this;
198 Scalar V = computeVolume();
199 Vec3s s(halfSide.cwiseAbs2() * V);
200 return (
Vec3s(s[1] + s[2], s[0] + s[2], s[0] + s[1]) / 3).asDiagonal();
214 if (value <= minInflationValue())
216 <<
"is two small. It should be at least: "
217 << minInflationValue(),
218 std::invalid_argument);
219 return std::make_pair(
Box(2 * (halfSide + Vec3s::Constant(value))),
225 const Box* other_ptr =
dynamic_cast<const Box*
>(&_other);
226 if (other_ptr ==
nullptr)
return false;
227 const Box& other = *other_ptr;
229 return halfSide == other.
halfSide &&
234 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
260 Scalar I =
Scalar(0.4) * radius * radius * computeVolume();
261 return I * Matrix3s::Identity();
265 return 4 * boost::math::constants::pi<Scalar>() * radius * radius * radius /
280 if (value <= minInflationValue())
282 <<
") is two small. It should be at least: "
283 << minInflationValue(),
284 std::invalid_argument);
290 const Sphere* other_ptr =
dynamic_cast<const Sphere*
>(&_other);
291 if (other_ptr ==
nullptr)
return false;
292 const Sphere& other = *other_ptr;
294 return radius == other.
radius &&
299 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
328 Scalar V = computeVolume();
329 Scalar a2 = V * radii[0] * radii[0];
330 Scalar b2 = V * radii[1] * radii[1];
331 Scalar c2 = V * radii[2] * radii[2];
333 return (
Matrix3s() << alpha * (b2 + c2), 0, 0, 0, alpha * (a2 + c2), 0, 0,
334 0, alpha * (a2 + b2))
339 return 4 * boost::math::constants::pi<Scalar>() * radii[0] * radii[1] *
354 if (value <= minInflationValue())
356 <<
") is two small. It should be at least: "
357 << minInflationValue(),
358 std::invalid_argument);
359 return std::make_pair(
Ellipsoid(radii + Vec3s::Constant(value)),
366 if (other_ptr ==
nullptr)
return false;
369 return radii == other.
radii &&
374 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
387 halfLength = lz_ / 2;
391 :
ShapeBase(other), radius(other.radius), halfLength(other.halfLength) {}
409 return boost::math::constants::pi<Scalar>() * radius * radius *
410 ((halfLength * 2) + radius * 4 /
Scalar(3));
414 Scalar v_cyl = radius * radius * (halfLength * 2) *
415 boost::math::constants::pi<Scalar>();
416 Scalar v_sph = radius * radius * radius *
417 boost::math::constants::pi<Scalar>() * 4 /
Scalar(3);
419 Scalar h2 = halfLength * halfLength;
420 Scalar r2 = radius * radius;
423 v_sph * (
Scalar(0.4) * r2 + h2 +
Scalar(0.75) * radius * halfLength);
426 return (
Matrix3s() << ix, 0, 0, 0, ix, 0, 0, 0, iz).finished();
440 if (value <= minInflationValue())
442 <<
") is two small. It should be at least: "
443 << minInflationValue(),
444 std::invalid_argument);
445 return std::make_pair(
Capsule(radius + value, 2 * halfLength),
452 if (other_ptr ==
nullptr)
return false;
453 const Capsule& other = *other_ptr;
460 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
472 halfLength = lz_ / 2;
476 :
ShapeBase(other), radius(other.radius), halfLength(other.halfLength) {}
494 return boost::math::constants::pi<Scalar>() * radius * radius *
495 (halfLength * 2) / 3;
499 Scalar V = computeVolume();
501 V * (
Scalar(0.4) * halfLength * halfLength + 3 * radius * radius / 20);
504 return (
Matrix3s() << ix, 0, 0, 0, ix, 0, 0, 0, iz).finished();
520 if (value <= minInflationValue())
522 <<
") is two small. It should be at least: "
523 << minInflationValue(),
524 std::invalid_argument);
527 const Scalar tan_alpha = 2 * halfLength / radius;
528 const Scalar sin_alpha = tan_alpha / std::sqrt(1 + tan_alpha * tan_alpha);
529 const Scalar top_inflation = value / sin_alpha;
530 const Scalar bottom_inflation = value;
532 const Scalar new_lz = 2 * halfLength + top_inflation + bottom_inflation;
533 const Scalar new_cz = (top_inflation + bottom_inflation) /
Scalar(2);
534 const Scalar new_radius = new_lz / tan_alpha;
536 return std::make_pair(
Cone(new_radius, new_lz),
542 const Cone* other_ptr =
dynamic_cast<const Cone*
>(&_other);
543 if (other_ptr ==
nullptr)
return false;
544 const Cone& other = *other_ptr;
551 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
562 halfLength = lz_ / 2;
566 :
ShapeBase(other), radius(other.radius), halfLength(other.halfLength) {}
569 if (
this == &other)
return *
this;
571 this->radius = other.
radius;
592 return boost::math::constants::pi<Scalar>() * radius * radius *
597 Scalar V = computeVolume();
598 Scalar ix = V * (radius * radius / 4 + halfLength * halfLength / 3);
599 Scalar iz = V * radius * radius / 2;
600 return (
Matrix3s() << ix, 0, 0, 0, ix, 0, 0, 0, iz).finished();
614 if (value <= minInflationValue())
616 <<
") is two small. It should be at least: "
617 << minInflationValue(),
618 std::invalid_argument);
619 return std::make_pair(
Cylinder(radius + value, 2 * (halfLength + value)),
626 if (other_ptr ==
nullptr)
return false;
634 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
654 unsigned int num_points,
bool keepTriangles,
655 const char* qhullCommand = NULL);
659 const Vec3s* points,
unsigned int num_points,
bool keepTriangles,
660 const char* qhullCommand = NULL);
675 #ifdef COAL_HAS_QHULL
678 void buildDoubleDescription();
685 unsigned char const&
count()
const {
return count_; }
696 if (count_ != other.
count_)
return false;
698 for (
int i = 0; i < count_; ++i) {
699 if (n_[i] != other.
n_[i])
return false;
710 static constexpr
size_t num_vertices_large_convex_threshold = 32;
713 std::shared_ptr<std::vector<Vec3s>>
points;
748 static constexpr
size_t num_support_warm_starts = 14;
759 num_normals_and_offsets(0),
760 center(
Vec3s::Zero()) {}
769 unsigned int num_points_);
776 void set(std::shared_ptr<std::vector<Vec3s>> points_,
777 unsigned int num_points_);
783 #ifdef COAL_HAS_QHULL
784 void buildDoubleDescriptionFromQHullResult(
const orgQhull::Qhull& qh);
798 void computeCenter();
802 if (other_ptr ==
nullptr)
return false;
805 if (num_points != other.
num_points)
return false;
807 if ((!(points.get()) && other.
points.get()) ||
808 (points.get() && !(other.
points.get())))
810 if (points.get() && other.
points.get()) {
811 const std::vector<Vec3s>& points_ = *points;
812 const std::vector<Vec3s>& other_points_ = *(other.
points);
813 for (
unsigned int i = 0; i < num_points; ++i) {
814 if (points_[i] != (other_points_)[i])
return false;
818 if ((!(neighbors.get()) && other.
neighbors.get()) ||
819 (neighbors.get() && !(other.
neighbors.get())))
821 if (neighbors.get() && other.
neighbors.get()) {
822 const std::vector<Neighbors>& neighbors_ = *neighbors;
823 const std::vector<Neighbors>& other_neighbors_ = *(other.
neighbors);
824 for (
unsigned int i = 0; i < num_points; ++i) {
825 if (neighbors_[i] != other_neighbors_[i])
return false;
829 if ((!(normals.get()) && other.
normals.get()) ||
830 (normals.get() && !(other.
normals.get())))
832 if (normals.get() && other.
normals.get()) {
833 const std::vector<Vec3s>& normals_ = *normals;
834 const std::vector<Vec3s>& other_normals_ = *(other.
normals);
835 for (
unsigned int i = 0; i < num_normals_and_offsets; ++i) {
836 if (normals_[i] != other_normals_[i])
return false;
840 if ((!(offsets.get()) && other.
offsets.get()) ||
841 (offsets.get() && !(other.
offsets.get())))
843 if (offsets.get() && other.
offsets.get()) {
844 const std::vector<Scalar>& offsets_ = *offsets;
845 const std::vector<Scalar>& other_offsets_ = *(other.
offsets);
846 for (
unsigned int i = 0; i < num_normals_and_offsets; ++i) {
847 if (offsets_[i] != other_offsets_[i])
return false;
851 if (this->support_warm_starts.
points.size() !=
853 this->support_warm_starts.
indices.size() !=
858 for (
size_t i = 0; i < this->support_warm_starts.
points.size(); ++i) {
859 if (this->support_warm_starts.
points[i] !=
861 this->support_warm_starts.indices[i] !=
867 return center == other.
center &&
872 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
875 template <
typename PolygonT>
902 :
ShapeBase(other), n(other.n), d(other.d) {}
915 return n.dot(p) - (d + this->getSweptSphereRadius());
919 return std::abs(this->signedDistance(p));
929 return std::numeric_limits<Scalar>::lowest();
941 if (value <= minInflationValue())
943 <<
") is two small. It should be at least: "
944 << minInflationValue(),
945 std::invalid_argument);
962 if (other_ptr ==
nullptr)
return false;
965 return n == other.
n && d == other.
d &&
970 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
1005 const Scalar dist = n.dot(p) - d;
1006 Scalar signed_dist = std::abs(n.dot(p) - d) - this->getSweptSphereRadius();
1010 if (signed_dist >= 0) {
1011 return -signed_dist;
1017 return std::abs(std::abs(n.dot(p) - d) - this->getSweptSphereRadius());
1038 const Plane* other_ptr =
dynamic_cast<const Plane*
>(&_other);
1039 if (other_ptr ==
nullptr)
return false;
1040 const Plane& other = *other_ptr;
1042 return n == other.
n && d == other.
d &&
1047 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Center at zero point, axis aligned box.
Definition: geometric_shapes.h:164
Capsule It is where is the distance between the point x and the capsule segment AB,...
Definition: geometric_shapes.h:381
The geometry for the object for collision or distance computation.
Definition: collision_object.h:94
Cone The base of the cone is at and the top is at .
Definition: geometric_shapes.h:466
Base for convex polytope.
Definition: geometric_shapes.h:639
Cylinder along Z axis. The cylinder is defined at its centroid.
Definition: geometric_shapes.h:556
Ellipsoid centered at point zero.
Definition: geometric_shapes.h:303
Half Space: this is equivalent to the Plane in ODE. A Half space has a priviledged direction: the dir...
Definition: geometric_shapes.h:886
Infinite plane. A plane can be viewed as two half spaces; it has no priviledged direction....
Definition: geometric_shapes.h:977
Base class for all basic geometric shapes.
Definition: geometric_shapes.h:58
Center at zero point sphere.
Definition: geometric_shapes.h:238
Triangle stores the points instead of only indices of points.
Definition: geometric_shapes.h:108
#define COAL_DLLAPI
Definition: config.hh:88
#define COAL_DEPRECATED
Definition: deprecated.hh:37
#define COAL_THROW_PRETTY(message, exception)
Definition: fwd.hh:64
@ GEOM_CONE
Definition: collision_object.h:77
@ GEOM_TRIANGLE
Definition: collision_object.h:82
@ GEOM_BOX
Definition: collision_object.h:74
@ GEOM_SPHERE
Definition: collision_object.h:75
@ GEOM_CYLINDER
Definition: collision_object.h:78
@ GEOM_CAPSULE
Definition: collision_object.h:76
@ GEOM_ELLIPSOID
Definition: collision_object.h:84
@ GEOM_HALFSPACE
Definition: collision_object.h:81
@ GEOM_PLANE
Definition: collision_object.h:80
@ GEOM_CONVEX
Definition: collision_object.h:79
@ OT_GEOM
Definition: collision_object.h:55
Scalar minInflationValue() const
Definition: geometric_shapes.h:429
Matrix3s computeMomentofInertia() const
compute the inertia matrix, related to the origin
Definition: geometric_shapes.h:596
Matrix3s computeMomentofInertia() const
compute the inertia matrix, related to the origin
Definition: geometric_shapes.h:413
ShapeBase & operator=(const ShapeBase &other)=default
virtual Capsule * clone() const
Clone *this into a new Capsule.
Definition: geometric_shapes.h:394
Scalar minInflationValue() const
Definition: geometric_shapes.h:269
virtual ~ShapeBase()
Definition: geometric_shapes.h:69
ShapeBase(const ShapeBase &other)
 
Definition: geometric_shapes.h:63
Scalar minInflationValue() const
Definition: geometric_shapes.h:928
Scalar halfLength
Half Length along z axis.
Definition: geometric_shapes.h:400
Scalar distance(const Vec3s &p) const
Definition: geometric_shapes.h:1016
Vec3s n
Plane normal.
Definition: geometric_shapes.h:950
Scalar radius
Radius of the cylinder.
Definition: geometric_shapes.h:577
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 neighbor...
Definition: geometric_shapes.h:795
unsigned int * n_
Definition: geometric_shapes.h:683
Scalar computeVolume() const
compute the volume
Definition: geometric_shapes.h:591
bool operator==(const Neighbors &other) const
Definition: geometric_shapes.h:695
Plane()
Definition: geometric_shapes.h:990
Capsule(Scalar radius_, Scalar lz_)
Definition: geometric_shapes.h:386
std::pair< Cone, Transform3s > inflated(const Scalar value) const
Inflate the cone by an amount given by value. This value can be positive or negative but must always ...
Definition: geometric_shapes.h:519
Box & operator=(const Box &other)
Definition: geometric_shapes.h:173
Capsule(const Capsule &other)
Definition: geometric_shapes.h:390
Cylinder(Scalar radius_, Scalar lz_)
Definition: geometric_shapes.h:561
unsigned int const & operator[](int i) const
Definition: geometric_shapes.h:690
Halfspace & operator=(const Halfspace &other)
operator =
Definition: geometric_shapes.h:905
Scalar d
Plane offset.
Definition: geometric_shapes.h:953
bool operator!=(const Neighbors &other) const
Definition: geometric_shapes.h:705
Vec3s n
Plane normal.
Definition: geometric_shapes.h:1027
virtual Box * clone() const
Clone *this into a new Box.
Definition: geometric_shapes.h:181
Matrix3s computeMomentofInertia() const
compute the inertia matrix, related to the origin
Definition: geometric_shapes.h:259
Box()
Default constructor.
Definition: geometric_shapes.h:184
void setSweptSphereRadius(Scalar radius)
Set radius of sphere swept around the shape. Must be >= 0.
Definition: geometric_shapes.h:76
Sphere(const Sphere &other)
Definition: geometric_shapes.h:245
void computeLocalAABB()
Compute AABB.
virtual TriangleP * clone() const
Clone *this into a new TriangleP.
Definition: geometric_shapes.h:119
std::pair< Capsule, Transform3s > inflated(const Scalar value) const
Inflate the capsule by an amount given by value. This value can be positive or negative but must alwa...
Definition: geometric_shapes.h:439
Scalar halfLength
Half Length along z axis.
Definition: geometric_shapes.h:485
unsigned char const & count() const
Definition: geometric_shapes.h:685
std::pair< Box, Transform3s > inflated(const Scalar value) const
Inflate the box by an amount given by value. This value can be positive or negative but must always >...
Definition: geometric_shapes.h:213
virtual Plane * clone() const
Clone *this into a new Plane.
Definition: geometric_shapes.h:1002
Cone(Scalar radius_, Scalar lz_)
Definition: geometric_shapes.h:471
std::shared_ptr< std::vector< Vec3s > > normals
An array of the normals of the polygon.
Definition: geometric_shapes.h:717
Ellipsoid(const Ellipsoid &other)
Definition: geometric_shapes.h:312
Scalar distance(const Vec3s &p) const
Definition: geometric_shapes.h:918
NODE_TYPE getNodeType() const
get the node type
Definition: geometric_shapes.h:124
TriangleP(const TriangleP &other)
Definition: geometric_shapes.h:115
Cylinder()
Default constructor.
Definition: geometric_shapes.h:559
void computeLocalAABB()
Compute AABB.
std::pair< Halfspace, Transform3s > inflated(const Scalar value) const
Inflate the halfspace by an amount given by value. This value can be positive or negative but must al...
Definition: geometric_shapes.h:940
Ellipsoid()
Default constructor.
Definition: geometric_shapes.h:306
unsigned int num_points
Definition: geometric_shapes.h:714
void computeLocalAABB()
Compute AABB.
Plane(const Vec3s &n_, Scalar d_)
Construct a plane with normal direction and offset.
Definition: geometric_shapes.h:980
Plane(const Plane &other)
Definition: geometric_shapes.h:992
Box(Scalar x, Scalar y, Scalar z)
Definition: geometric_shapes.h:166
Scalar minInflationValue() const
Definition: geometric_shapes.h:603
void buildSupportWarmStart()
Build the support points warm starts.
Matrix3s computeMomentofInertia() const
compute the inertia matrix, related to the origin
Definition: geometric_shapes.h:327
Halfspace(const Halfspace &other)
Definition: geometric_shapes.h:901
Halfspace(Scalar a, Scalar b, Scalar c, Scalar d_)
Construct a plane with normal direction and offset.
Definition: geometric_shapes.h:894
std::pair< Sphere, Transform3s > inflated(const Scalar value) const
Inflate the sphere by an amount given by value. This value can be positive or negative but must alway...
Definition: geometric_shapes.h:279
NODE_TYPE getNodeType() const
Get node type: an ellipsoid.
Definition: geometric_shapes.h:325
NODE_TYPE getNodeType() const
Get node type: a cone.
Definition: geometric_shapes.h:491
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 ...
Definition: geometric_shapes.h:726
Ellipsoid(const Vec3s &radii)
Definition: geometric_shapes.h:310
virtual ConvexBase * clone() const
Clone (deep copy). This method is consistent with BVHModel clone method. The copy constructor is call...
Definition: geometric_shapes.h:667
Scalar minInflationValue() const
Definition: geometric_shapes.h:509
void computeLocalAABB()
Compute AABB.
Vec3s halfSide
box side half-length
Definition: geometric_shapes.h:187
Halfspace()
Definition: geometric_shapes.h:899
void set(std::shared_ptr< std::vector< Vec3s >> points_, unsigned int num_points_)
Set the points of the convex shape.
Sphere()
Default constructor.
Definition: geometric_shapes.h:241
Scalar minInflationValue() const
Definition: geometric_shapes.h:203
NODE_TYPE getNodeType() const
Get node type: a convex polytope.
Definition: geometric_shapes.h:673
Scalar computeVolume() const
compute the volume
Definition: geometric_shapes.h:408
Scalar computeVolume() const
compute the volume
Definition: geometric_shapes.h:195
void initialize(std::shared_ptr< std::vector< Vec3s >> points_, unsigned int num_points_)
Initialize the points of the convex shape This also initializes the ConvexBase::center.
Matrix3s computeMomentofInertia() const
compute the inertia matrix, related to the origin
Definition: geometric_shapes.h:197
Vec3s a
Definition: geometric_shapes.h:147
Halfspace(const Vec3s &n_, Scalar d_)
Construct a half space with normal direction and offset.
Definition: geometric_shapes.h:889
Scalar signedDistance(const Vec3s &p) const
Definition: geometric_shapes.h:914
OBJECT_TYPE getObjectType() const
Get object type: a geometric shape.
Definition: geometric_shapes.h:72
void computeLocalAABB()
Compute AABB.
Vec3s b
Definition: geometric_shapes.h:147
void computeLocalAABB()
Compute AABB.
Scalar computeVolume() const
compute the volume
Definition: geometric_shapes.h:338
virtual Ellipsoid * clone() const
Clone *this into a new Ellipsoid.
Definition: geometric_shapes.h:315
Scalar radius
Radius of the cone.
Definition: geometric_shapes.h:479
void unitNormalTest()
Turn non-unit normal into unit.
void computeLocalAABB()
Compute AABB.
Scalar radius
Radius of the sphere.
Definition: geometric_shapes.h:248
std::pair< Ellipsoid, Transform3s > inflated(const Scalar value) const
Inflate the ellipsoid by an amount given by value. This value can be positive or negative but must al...
Definition: geometric_shapes.h:353
void computeLocalAABB()
Compute AABB.
Scalar halfLength
Half Length along z axis.
Definition: geometric_shapes.h:583
unsigned int & operator[](int i)
Definition: geometric_shapes.h:686
Vec3s computeCOM() const
compute center of mass
Definition: geometric_shapes.h:507
Scalar getSweptSphereRadius() const
Get radius of sphere swept around the shape. This radius is always >= 0.
Definition: geometric_shapes.h:86
static ConvexBase * convexHull(const Vec3s *points, unsigned int num_points, bool keepTriangles, const char *qhullCommand=NULL)
std::vector< int > indices
Indices of the support points warm starts. These are the indices of the real convex,...
Definition: geometric_shapes.h:744
Vec3s radii
Radii of the Ellipsoid (such that on boundary: x^2/rx^2 + y^2/ry^2.
Definition: geometric_shapes.h:315
Scalar minInflationValue() const
Definition: geometric_shapes.h:343
Cylinder(const Cylinder &other)
Definition: geometric_shapes.h:565
Scalar computeVolume() const
compute the volume
Definition: geometric_shapes.h:493
Vec3s c
Definition: geometric_shapes.h:147
NODE_TYPE getNodeType() const
Get node type: a sphere.
Definition: geometric_shapes.h:257
virtual Sphere * clone() const
Clone *this into a new Sphere.
Definition: geometric_shapes.h:248
Plane & operator=(const Plane &other)
operator =
Definition: geometric_shapes.h:995
std::vector< Vec3s > points
Array of support points to warm start the support function computation.
Definition: geometric_shapes.h:739
virtual Cone * clone() const
Clone *this into a new Cone.
Definition: geometric_shapes.h:479
unsigned int num_normals_and_offsets
Definition: geometric_shapes.h:721
Sphere(Scalar radius_)
Definition: geometric_shapes.h:243
Box(const Vec3s &side_)
Definition: geometric_shapes.h:169
void unitNormalTest()
Turn non-unit normal into unit.
Vec3s center
center of the convex polytope, this is used for collision: center is guaranteed in the internal of th...
Definition: geometric_shapes.h:730
unsigned char count_
Definition: geometric_shapes.h:682
ConvexBase()
Construct an uninitialized convex object Initialization is done with ConvexBase::initialize.
Definition: geometric_shapes.h:756
void computeLocalAABB()
virtual function of compute AABB in local coordinate
std::pair< Cylinder, Transform3s > inflated(const Scalar value) const
Inflate the cylinder by an amount given by value. This value can be positive or negative but must alw...
Definition: geometric_shapes.h:613
NODE_TYPE getNodeType() const
Get node type: a cylinder.
Definition: geometric_shapes.h:589
ShapeBase()
Definition: geometric_shapes.h:60
Matrix3s computeMomentofInertia() const
compute the inertia matrix, related to the origin
Definition: geometric_shapes.h:498
Ellipsoid(Scalar rx, Scalar ry, Scalar rz)
Definition: geometric_shapes.h:308
Box(const Box &other)
Definition: geometric_shapes.h:171
TriangleP()
Definition: geometric_shapes.h:110
std::shared_ptr< std::vector< Vec3s > > points
An array of the points of the polygon.
Definition: geometric_shapes.h:713
Capsule()
Default constructor.
Definition: geometric_shapes.h:384
Scalar radius
Radius of capsule.
Definition: geometric_shapes.h:394
Scalar signedDistance(const Vec3s &p) const
Definition: geometric_shapes.h:1004
std::shared_ptr< std::vector< Scalar > > offsets
An array of the offsets to the normals of the polygon. Note: there are as many offsets as normals.
Definition: geometric_shapes.h:720
static ConvexBase * convexHull(std::shared_ptr< std::vector< Vec3s >> &points, unsigned int num_points, bool keepTriangles, const char *qhullCommand=NULL)
Build a convex hull based on Qhull library and store the vertices and optionally the triangles.
NODE_TYPE getNodeType() const
Get node type: a half space.
Definition: geometric_shapes.h:926
TriangleP(const Vec3s &a_, const Vec3s &b_, const Vec3s &c_)
Definition: geometric_shapes.h:112
virtual Cylinder * clone() const
Clone *this into a new Cylinder.
Definition: geometric_shapes.h:577
Cone()
Default constructor.
Definition: geometric_shapes.h:469
Cylinder & operator=(const Cylinder &other)
Definition: geometric_shapes.h:568
ConvexBase(const ConvexBase &other)
Copy constructor Only the list of neighbors is copied.
Scalar computeVolume() const
compute the volume
Definition: geometric_shapes.h:264
NODE_TYPE getNodeType() const
Get node type: a plane.
Definition: geometric_shapes.h:1024
SupportWarmStartPolytope support_warm_starts
Support warm start polytopes.
Definition: geometric_shapes.h:751
Cone(const Cone &other)
Definition: geometric_shapes.h:475
NODE_TYPE getNodeType() const
Get node type: a box.
Definition: geometric_shapes.h:193
virtual Halfspace * clone() const
Clone *this into a new Halfspace.
Definition: geometric_shapes.h:912
void computeLocalAABB()
Compute AABB.
NODE_TYPE getNodeType() const
Get node type: a capsule.
Definition: geometric_shapes.h:406
Scalar d
Plane offset.
Definition: geometric_shapes.h:1030
Plane(Scalar a, Scalar b, Scalar c, Scalar d_)
Construct a plane with normal direction and offset.
Definition: geometric_shapes.h:985
Main namespace.
Definition: broadphase_bruteforce.h:44
NODE_TYPE
traversal node type: bounding volume (AABB, OBB, RSS, kIOS, OBBRSS, KDOP16, KDOP18,...
Definition: collision_object.h:64
Eigen::Matrix< Scalar, 3, 1 > Vec3s
Definition: data_types.h:70
double Scalar
Definition: data_types.h:68
OBJECT_TYPE
object type: BVH (mesh, points), basic geometry, octree
Definition: collision_object.h:52
Eigen::Matrix< Scalar, 3, 3 > Matrix3s
Definition: data_types.h:74
bool isEqual(const Eigen::MatrixBase< Derived > &lhs, const Eigen::MatrixBase< OtherDerived > &rhs, const Scalar tol=std::numeric_limits< Scalar >::epsilon() *100)
Definition: tools.h:204
Definition: geometric_shapes.h:681
The support warm start polytope contains certain points of this which are support points in specific ...
Definition: geometric_shapes.h:736