diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/approximate_convex_decomposition.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/approximate_convex_decomposition.h index 264612085f4..fa1a012fc3c 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/approximate_convex_decomposition.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/approximate_convex_decomposition.h @@ -16,6 +16,7 @@ #include #include +#include #include @@ -30,9 +31,6 @@ #include #include -#include -#include - #include #include #include @@ -46,11 +44,6 @@ #include #endif -#include -#include - -#include - namespace CGAL { namespace Polygon_mesh_processing { namespace internal { @@ -742,36 +735,6 @@ typename GeomTraits::FT volume(const std::vector & return vol; } - -template -void convex_hull(const PointRange& pts, std::vector &hull_points, std::vector > &hull_indices) { - using Mesh = CGAL::Surface_mesh; - Mesh m; - - convex_hull_3(pts.begin(), pts.end(), m); -// if (pts.size() < 20) { -// export_points("convex_hull" + std::to_string(cnt) + ".xyz", pts); -// std::cout << pts.size() << " " << cnt++ << std::endl; -// convex_hull_3(pts.begin(), pts.end(), hull_points, hull_indices);// needs bugfix in convex_hull_3 for indexed triangle list -// } - hull_points.resize(m.number_of_vertices()); - hull_indices.resize(m.number_of_faces()); - - std::size_t idx = 0; - for (const typename Mesh::vertex_index v : m.vertices()) - hull_points[idx++] = m.point(v); - - idx = 0; - for (const typename Mesh::face_index f : m.faces()) { - auto he = m.halfedge(f); - hull_indices[idx][0] = m.source(he); - he = m.next(he); - hull_indices[idx][1] = m.source(he); - he = m.next(he); - hull_indices[idx++][2] = m.source(he); - } -} - void enlarge(Bbox_uint& bbox, const Vec3_uint& v) { bbox.lower[0] = (std::min)(bbox.lower[0], v[0]); bbox.lower[1] = (std::min)(bbox.lower[1], v[1]); @@ -846,7 +809,7 @@ void compute_candidate(Candidate &c, const Bbox_3& bb, typename Geom voxel_points.insert(Point_3(xmax, ymax, zmax)); } - convex_hull(voxel_points, c.ch.points, c.ch.indices); + convex_hull_3(voxel_points.begin(), voxel_points.end(), c.ch.points, c.ch.indices); c.ch.volume = volume(c.ch.points, c.ch.indices); @@ -1295,7 +1258,7 @@ void merge(std::vector>& candidates, const typ std::vector pts(ci.points.begin(), ci.points.end()); pts.reserve(pts.size() + cj.points.size()); std::copy(cj.points.begin(), cj.points.end(), std::back_inserter(pts)); - convex_hull(pts, ch.points, ch.indices); + convex_hull_3(pts.begin(), pts.end(), ch.points, ch.indices); ch.volume = volume(ch.points, ch.indices); @@ -1430,7 +1393,7 @@ void merge(std::vector>& candidates, const typ std::vector pts(ci.points.begin(), ci.points.end()); pts.reserve(pts.size() + cj.points.size()); std::copy(cj.points.begin(), cj.points.end(), std::back_inserter(pts)); - convex_hull(pts, ch.points, ch.indices); + convex_hull_3(pts.begin(), pts.end(), ch.points, ch.indices); ch.volume = volume(ch.points, ch.indices); @@ -1452,7 +1415,7 @@ void merge(std::vector>& candidates, const typ std::vector pts(ci.points.begin(), ci.points.end()); pts.reserve(pts.size() + cj.points.size()); std::copy(cj.points.begin(), cj.points.end(), std::back_inserter(pts)); - convex_hull(pts, ch.points, ch.indices); + convex_hull_3(pts.begin(), pts.end(), ch.points, ch.indices); ch.volume = volume(ch.points, ch.indices); @@ -1503,7 +1466,7 @@ void merge(std::vector>& candidates, const typ std::vector pts(ci.points.begin(), ci.points.end()); pts.reserve(pts.size() + cj.points.size()); std::copy(cj.points.begin(), cj.points.end(), std::back_inserter(pts)); - convex_hull(pts, ch.points, ch.indices); + convex_hull_3(pts.begin(), pts.end(), ch.points, ch.indices); ch.volume = volume(ch.points, ch.indices); diff --git a/Polygon_mesh_processing/package_info/Polygon_mesh_processing/dependencies b/Polygon_mesh_processing/package_info/Polygon_mesh_processing/dependencies index a95eb459dc5..939741eec28 100644 --- a/Polygon_mesh_processing/package_info/Polygon_mesh_processing/dependencies +++ b/Polygon_mesh_processing/package_info/Polygon_mesh_processing/dependencies @@ -34,7 +34,6 @@ Spatial_searching Spatial_sorting Stream_support Subdivision_method_3 -Surface_mesh TDS_2 TDS_3 Triangulation_2