Definition of a capsule.
The capsule can be thought of as a cylinder with spherical caps attached. The capsule's length refers to the length of the cylindrical region, and the radius applies to both the cylinder and spherical caps. A capsule with zero length is a sphere of the given radius. And a capsule with zero radius is a line segment with the given length. The capsule is defined in its canonical frame C, centered on the frame origin and with the length of the capsule parallel with the frame's z-axis.
#include <drake/geometry/shape_specification.h>
Public Member Functions | |
Capsule (double radius, double length) | |
Constructs a capsule with the given radius and length . More... | |
double | radius () const |
double | length () const |
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable | |
Capsule (const Capsule &)=default | |
Capsule & | operator= (const Capsule &)=default |
Capsule (Capsule &&)=default | |
Capsule & | operator= (Capsule &&)=default |
![]() | |
virtual | ~Shape () |
void | Reify (ShapeReifier *reifier, void *user_data=nullptr) const |
Causes this description to be reified in the given reifier . More... | |
std::unique_ptr< Shape > | Clone () const |
Creates a unique copy of this shape. More... | |
Additional Inherited Members | |
![]() | |
template<typename S > | |
Shape (ShapeTag< S > tag) | |
Constructor available for derived class construction. More... | |
Shape (const Shape &)=default | |
Shape & | operator= (const Shape &)=default |
Shape (Shape &&)=default | |
Shape & | operator= (Shape &&)=default |
Capsule | ( | double | radius, |
double | length | ||
) |
Constructs a capsule with the given radius
and length
.
std::exception | if radius or length are not strictly positive. |
double length | ( | ) | const |
double radius | ( | ) | const |