27#ifndef EASY3D_ALGO_POLYGON_PARTITION_H
28#define EASY3D_ALGO_POLYGON_PARTITION_H
33#include "easy3d/core/types.h"
65 static bool apply_OPT(
const std::vector<vec2> &poly, std::vector<Polygon> &parts);
81 static bool apply_HM(
const std::vector<vec2> &poly, std::vector<Polygon> &parts);
102 static bool apply(
const std::vector<vec2> &points,
103 const std::vector<Polygon> &polys,
104 const std::vector<Polygon> &holes,
105 std::vector<Polygon> &parts);
Convex partition of polygons.
Definition: polygon_partition.h:44
static bool apply_HM(const std::vector< vec2 > &poly, std::vector< Polygon > &parts)
Partition a polygon into convex polygons by using the Hertel-Mehlhorn algorithm.
Definition: polygon_partition.cpp:64
PolygonPartition()=default
Default constructor.
static bool apply(const std::vector< vec2 > &points, const std::vector< Polygon > &polys, const std::vector< Polygon > &holes, std::vector< Polygon > &parts)
Convex partition of a general polygon with an arbitrary number of non-hole and hole contours.
Definition: polygon_partition.cpp:92
static bool apply_OPT(const std::vector< vec2 > &poly, std::vector< Polygon > &parts)
Optimal convex partition (in terms of number of resulting convex polygons) of a polygon into convex p...
Definition: polygon_partition.cpp:36
std::vector< std::size_t > Polygon
An indexed polygon representation (defined by vertex indices).
Definition: polygon_partition.h:47
Definition: collider.cpp:182