PPL API Reference |
|
---|
Public Member Functions | |
Construction | |
GMSPolyhedron () | |
GMSPolyhedron (const GMSPolyhedron &_p) | |
GMSPolyhedron (GMSPolyhedron &&_p) | |
GMSPolyhedron (glutils::triangulated_model &&_t) | |
~GMSPolyhedron () | |
Assignment | |
GMSPolyhedron & | operator= (const GMSPolyhedron &_p) |
GMSPolyhedron & | operator= (GMSPolyhedron &&_p) |
Transformation | |
GMSPolyhedron & | operator*= (const Transformation &_t) |
Apply a transformation to the polyhedron. | |
void | Invert () |
Invert the polyhedron so that normals face the opposite direction. | |
void | Scale (double _scalingFactor) |
Equality | |
bool | operator== (const GMSPolyhedron &_p) const |
bool | operator!= (const GMSPolyhedron &_p) const |
IO Functions | |
Vector3d | Read (const std::string &_fileName, COMAdjust _comAdjust) |
Vector3d | LoadFromIModel (IModel *_imodel, COMAdjust _comAdjust) |
void | WriteBYU (std::ostream &_os) const |
void | WriteObj (std::ostream &_os) const |
Accessors | |
std::vector< Vector3d > & | GetVertexList () noexcept |
std::vector< GMSPolygon > & | GetPolygonList () noexcept |
const std::vector< Vector3d > & | GetVertexList () const noexcept |
const std::vector< GMSPolygon > & | GetPolygonList () const noexcept |
const Vector3d & | GetCentroid () const |
Get the centroid of the polyhedron (average of the vertices). | |
double | GetSurfaceArea () const noexcept |
Get the total surface area of the polyhedron. | |
double | GetMaxRadius () const noexcept |
Get the maximum radius relative to the polyhedron's center. | |
double | GetMinRadius () const noexcept |
Get the minimum radius relative to the polyhedron's center. | |
Geometry Functions | |
Point3d | GetRandPtOnSurface () const |
Get a random point on the surface of the polyhedron. | |
std::unique_ptr< WorkspaceBoundingBox > | ComputeBoundingBox () const |
Compute an axis-aligned bounding box for this polyhedron. | |
GMSPolyhedron | ComputeConvexHull () const |
Compute the polyhedron's convex hull vertices and facets. | |
CGALPolyhedron | CGAL () const |
Get a CGAL polyhedron representation of this object. | |
void | UpdateCGALPoints () |
Collision Detection Models | |
RAPID_model * | GetRapidModel () const noexcept |
PQP_Model * | GetPQPModel () const noexcept |
const Vector3d & | GetInsidePoint () const noexcept |
Static Public Member Functions | |
Build Common Shapes | |
static GMSPolyhedron | MakeBox (const Range< double > &_x, const Range< double > &_y, const Range< double > &_z) |
Public Types | |
Local Types | |
enum class | COMAdjust { COM , Surface , None } |
typedef CGAL::Exact_predicates_exact_constructions_kernel | CGALKernel |
typedef CGALKernel::Point_3 | CGALPoint |
typedef CGAL::Polyhedron_3< CGALKernel > | CGALPolyhedron |
Geometric structure for polyhedra including vertices, faces, and surface area.
@TODO Replace this object with CGAL::Polyhedron_3 or at least extend from it. We really do not need three different classes to represent polyhedrons, and CGAL's representation is the most mature.
|
strong |
Center of mass adjustment approaches
This enum lists the method to adjust all vertices of a model. 'COM' will subtract the center of mass (com) from all vertices. 'Surface' will subtract only x and z components of the com from all vertices. 'None' will not perform any adjustment.
void GMSPolyhedron::Scale | ( | double | _scalingFactor | ) |
Scale a polyhedron by a factor and keep it centered at its original centroid.
_scalingFactor | The scaling factor |
Vector3d GMSPolyhedron::Read | ( | const std::string & | _fileName, |
COMAdjust | _comAdjust | ||
) |
Read in a geometry file in either BYU or OBJ format.
_fileName | The name of the file to read. |
_comAdjust | The type of COM adjustment to use. |
Vector3d GMSPolyhedron::LoadFromIModel | ( | IModel * | _imodel, |
COMAdjust | _comAdjust | ||
) |
Load vertices and triangles from the IModel, which loads all types of models.
_imodel | An IModel input. @param_comAdjust The COM adjustment type to use. |
void GMSPolyhedron::WriteBYU | ( | std::ostream & | _os | ) | const |
Output the model to a BYU-format file.
_os | The output stream to use. |
void GMSPolyhedron::WriteObj | ( | std::ostream & | _os | ) | const |
Output the model to a Obj-format file.
_os | The output stream to use. |
void GMSPolyhedron::UpdateCGALPoints | ( | ) |
Make sure the CGAL points match the vertex list. This is only needed for polys that are created manually rather than from file. The points will not be exact as they are copied from doubles.
|
noexcept |
Get the rapid CD model. It will be constructed if it doesn't already exist.
|
noexcept |
Get the pqp CD model. It will be constructed if it doesn't already exist.
|
noexcept |
Get a point just 'beneath' one of the facets to for is-inside-obstacle checks. This is to catch degenerate cases where the zero point.
|
static |
Build an axis-aligned box polyhedron.
_x | The min/max range in the x direction. |
_y | The min/max range in the y direction. |
_z | The min/max range in the z direction. |
2—–6 +Y /| /| | 3—–7 | |—+X | 0—|-4 / |/ |/ +Z 1—–5