diff --git a/BGL/include/CGAL/boost/graph/generators.h b/BGL/include/CGAL/boost/graph/generators.h index a4e91f177fb..842cc1dfdfe 100644 --- a/BGL/include/CGAL/boost/graph/generators.h +++ b/BGL/include/CGAL/boost/graph/generators.h @@ -348,6 +348,22 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3, return next(next(hb, g), g); } +/** + * \ingroup PkgBGLHelperFct + * \tparam IsoCuboid model of `IsoCuboid_3` + * \brief creates an isolated hexahedron + * equivalent to `c`, and adds it to the graph `g`. + * \returns the halfedge that has the target vertex associated with `c.min()`, + * in the bottom face of the cuboid. + **/ +template +typename boost::graph_traits::halfedge_descriptor +make_hexahedron(const IsoCuboid& c, Graph& g) +{ + return CGAL::make_hexahedron(c[0], c[1], c[2], c[3], + c[4], c[5], c[6], c[7], g); +} + /** * \ingroup PkgBGLHelperFct * \brief creates an isolated tetrahedron diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h index 5660a7cfdd5..015265a48bd 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/bbox.h @@ -331,18 +331,13 @@ namespace CGAL { using GT = typename GetGeomTraits::type; GT gt = choose_parameter(get_parameter(np, internal_np::geom_traits)); - using Point_3 = typename GT::Point_3; using Iso_cuboid_3 = typename GT::Iso_cuboid_3; - using Vector_3 = typename GT::Vector_3; const bool dont_triangulate = choose_parameter( get_parameter(np, internal_np::do_not_triangulate_faces), false); - const Iso_cuboid_3 bbext(CGAL::Polygon_mesh_processing::bbox(pmesh, np)); - PolygonMesh bbox_mesh; - CGAL::make_hexahedron(bbext[0], bbext[1], bbext[2], bbext[3], - bbext[4], bbext[5], bbext[6], bbext[7], + CGAL::make_hexahedron(Iso_cuboid_3(bbox(pmesh, np)), bbox_mesh); if(!dont_triangulate)