38 Polygon(std::vector<Position> vertices);
146 Eigen::VectorXd& b)
const;
215 static bool sortVertices(
const Eigen::Vector2d& vector1,
216 const Eigen::Vector2d& vector2);
224 const Eigen::Vector2d& vector2);
233 const Eigen::Vector2d& pointA,
234 const Eigen::Vector2d& pointB);
246 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
const std::string & getFrameId() const
static Polygon convexHullOfTwoCircles(Position center1, Position center2, double radius, int nVertices=20)
const Position & operator[](size_t index) const
static double computeCrossProduct2D(const Eigen::Vector2d &vector1, const Eigen::Vector2d &vector2)
Position getCentroid() const
static Polygon monotoneChainConvexHullOfPoints(const std::vector< Position > &points)
void setTimestamp(uint64_t timestamp)
uint64_t timestamp_
Timestamp of the polygon (nanoseconds).
const Position & getVertex(size_t index) const
std::string frameId_
Frame id of the polygon.
void addVertex(const Position &vertex)
static Polygon fromCircle(Position center, double radius, int nVertices=20)
bool offsetInward(double margin)
bool isInside(const Position &point) const
std::vector< Position > vertices_
Vertices of the polygon.
std::vector< Polygon > triangulate(const TriangulationMethods &method=TriangulationMethods::FAN) const
static Polygon convexHull(Polygon &polygon1, Polygon &polygon2)
static bool sortVertices(const Eigen::Vector2d &vector1, const Eigen::Vector2d &vector2)
static double vectorsMakeClockwiseTurn(const Eigen::Vector2d &pointO, const Eigen::Vector2d &pointA, const Eigen::Vector2d &pointB)
void setFrameId(const std::string &frameId)
bool thickenLine(double thickness)
uint64_t getTimestamp() const
bool convertToInequalityConstraints(Eigen::MatrixXd &A, Eigen::VectorXd &b) const
const std::vector< Position > & getVertices() const
void getBoundingBox(Position ¢er, Length &length) const