8 #include <pybind11/pybind11.h>
9 #include <pybind11/stl_bind.h>
17 using namespace pybind11::literals;
21 py::class_<cloudViewer::Delaunay2dMesh, cloudViewer::GenericIndexedMesh>(cccorelib,
"Delaunay2dMesh")
22 .def_property_readonly_static(
"USE_ALL_POINTS",
23 [](
const py::object & )
38 const std::vector<int> &,
43 .def(
"removeOuterTriangles",
45 const std::vector<CCVector2> &,
const std::vector<CCVector2> &,
bool removeOutside))(
49 "removeOutside"_a =
true)
50 .def(
"getTriangleVertIndexesArray",
52 py::return_value_policy::reference)
53 .def(
"getTriangleVertIndexesArray",
56 .def(
"getAssociatedCloud",
58 py::return_value_policy::reference)
59 .def_static(
"TesselateContour",
63 .def_static(
"TesselateContour",
67 "flatDimension"_a = -1);
void define_Delaunay2dMesh(py::module &cccorelib)
A class to compute and handle a Delaunay 2D mesh on a subset of points.
static Delaunay2dMesh * TesselateContour(const std::vector< CCVector2 > &contourPoints)
static bool Available()
Returns whether 2D Delaunay triangulation is supported or not.
virtual bool removeOuterTriangles(const std::vector< CCVector2 > &vertices2D, const std::vector< CCVector2 > &polygon2D, bool removeOutside=true)
Removes the triangles falling outside of a given (2D) polygon.
bool removeTrianglesWithEdgesLongerThan(PointCoordinateType maxEdgeLength)
Filters out the triangles based on their edge length.
virtual bool buildMesh(const std::vector< CCVector2 > &points2D, std::size_t pointCountToUse, std::string &outputErrorStr)
Build the Delaunay mesh on top a set of 2D points.
virtual void linkMeshWith(GenericIndexedCloud *aCloud, bool passOwnership=false)
Associate this mesh to a point cloud.
int * getTriangleVertIndexesArray()
Returns triangles indexes array (pointer to)
GenericIndexedCloud * getAssociatedCloud()
Returns associated cloud.
static constexpr int USE_ALL_POINTS
A generic 3D point cloud with index-based and presistent access to points.