3D polygon, inheriting from std::vector<TPoint3D>
- See also
- TPolygon2D,TSegment3D,TLine3D,TPlane,TPoint3D
Definition at line 1040 of file lightweight_geom_data.h.
#include <mrpt/math/lightweight_geom_data.h>
◆ TPolygon3D() [1/4]
mrpt::math::TPolygon3D::TPolygon3D |
( |
| ) |
|
|
inline |
◆ TPolygon3D() [2/4]
mrpt::math::TPolygon3D::TPolygon3D |
( |
size_t |
N | ) |
|
|
inlineexplicit |
Constructor for a given size.
Creates a polygon with a fixed number of vertices, which are initialized to garbage.
Definition at line 1059 of file lightweight_geom_data.h.
◆ TPolygon3D() [3/4]
mrpt::math::TPolygon3D::TPolygon3D |
( |
const std::vector< TPoint3D > & |
v | ) |
|
|
inline |
◆ TPolygon3D() [4/4]
mrpt::math::TPolygon3D::TPolygon3D |
( |
const TPolygon2D & |
p | ) |
|
|
explicit |
Constructor from a 2D object.
Zeroes the z.
◆ contains()
bool mrpt::math::TPolygon3D::contains |
( |
const TPoint3D & |
point | ) |
const |
Check whether a point is inside (or within geometryEpsilon of a polygon edge). This works for concave or convex polygons.
◆ createRegularPolygon() [1/2]
static void mrpt::math::TPolygon3D::createRegularPolygon |
( |
size_t |
numEdges, |
|
|
double |
radius, |
|
|
TPolygon3D & |
poly |
|
) |
| |
|
static |
Static method to create a regular polygon, given its size and radius.
- Exceptions
-
std::logic_error | if number of edges is less than three, or radius is near zero. |
◆ createRegularPolygon() [2/2]
Static method to create a regular polygon, given its size and radius.
The center will be located on the given pose.
- Exceptions
-
std::logic_error | if number of edges is less than three, or radius is near zero. |
◆ distance()
double mrpt::math::TPolygon3D::distance |
( |
const TPoint3D & |
point | ) |
const |
Distance to point (always >=0)
◆ generate2DObject()
void mrpt::math::TPolygon3D::generate2DObject |
( |
TPolygon2D & |
p | ) |
const |
|
inline |
◆ getAsSegmentList()
void mrpt::math::TPolygon3D::getAsSegmentList |
( |
std::vector< TSegment3D > & |
v | ) |
const |
Gets as set of segments, instead of set of points.
◆ getBestFittingPlane()
void mrpt::math::TPolygon3D::getBestFittingPlane |
( |
TPlane & |
p | ) |
const |
Gets the best fitting plane, disregarding whether the polygon actually fits inside or not.
- See also
- getBestFittingPlane
◆ getCenter()
void mrpt::math::TPolygon3D::getCenter |
( |
TPoint3D & |
p | ) |
const |
Get polygon's central point.
◆ getPlane()
bool mrpt::math::TPolygon3D::getPlane |
( |
TPlane & |
p | ) |
const |
Gets a plane which contains the polygon. Returns false if the polygon is skew and cannot be fit inside a plane.
◆ isSkew()
bool mrpt::math::TPolygon3D::isSkew |
( |
| ) |
const |
Check whether the polygon is skew. Returns true if there doesn't exist a plane in which the polygon can fit.
- See also
- getBestFittingPlane
◆ removeRedundantVertices()
void mrpt::math::TPolygon3D::removeRedundantVertices |
( |
| ) |
|
Erase every redundant vertex, thus saving space.
◆ removeRepeatedVertices()
void mrpt::math::TPolygon3D::removeRepeatedVertices |
( |
| ) |
|
Remove polygon's repeated vertices.
◆ elements
T std::vector< T >::elements |
|
inherited |