44 void getPlotData(std::vector<double>& x, std::vector<double>& y)
const;
61 size_t numEdges,
double radius,
TPolygon2D& poly);
68 size_t numEdges,
double radius,
TPolygon2D& poly,
static void createRegularPolygon(size_t numEdges, double radius, TPolygon2D &poly)
Static method to create a regular polygon, given its size and radius.
void getCenter(TPoint2D &p) const
Polygon's central point.
bool contains(const TPoint2D &point) const
Check whether a point is inside (or within geometryEpsilon of a polygon edge).
void removeRepeatedVertices()
Erase repeated vertices.
void removeRedundantVertices()
Erase every redundant vertex from the polygon, saving space.
This base provides a set of functions for maths stuff.
void getAsSegmentList(std::vector< TSegment2D > &v) const
Gets as set of segments, instead of points.
bool isConvex() const
Checks whether is convex.
double distance(const TPoint2D &point) const
Distance to a point (always >=0)
void getPlotData(std::vector< double > &x, std::vector< double > &y) const
Gets plot data, ready to use on a 2D plot.
TPolygon2D()
Default constructor.
#define MRPT_DECLARE_TTYPENAME_NO_NAMESPACE(_TYPE, __NS)
Declares a typename to be "type" (without the NS prefix)
TPolygon2D(size_t N)
Constructor for a given number of vertices, intializing them as garbage.
void getBoundingBox(TPoint2D &min_coords, TPoint2D &max_coords) const
Get polygon bounding box.
void generate3DObject(TPolygon3D &p) const
Projects into 3D space, zeroing the z.
2D polygon, inheriting from std::vector<TPoint2D>.
3D polygon, inheriting from std::vector<TPoint3D>
TPolygon2D(const std::vector< TPoint2D > &v)
Implicit constructor from a vector of 2D points.