diff --git a/Installation/CHANGES.md b/Installation/CHANGES.md index 3b0054258f4..eb1bbc93980 100644 --- a/Installation/CHANGES.md +++ b/Installation/CHANGES.md @@ -8,8 +8,8 @@ Release date: September 2018 ### Polygon Mesh Processing - Added two functions in Polygon Mesh Processing to perform an extrusion of an open polygon mesh: - - `CGAL::Polygon_mesh_processing::extrude_mesh(const InputMesh& input, OutputMesh& output, Vector_3 dir, const FT d, const NamedParameters1& np1, const NamedParameters2& np2)` - - `CGAL::Polygon_mesh_processing::generic_extrude_mesh(const InputMesh& input, OutputMesh& output, BottomFunctor& bot,TopFunctor& top)` + - `CGAL::Polygon_mesh_processing::extrude_mesh()` + - `CGAL::Polygon_mesh_processing::generic_extrude_mesh()` ### 2D and 3D Linear Geometry Kernel - An operator() that takes a Ray_3 has been added to the concept diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/extrude.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/extrude.h index a5b9ece4f43..94f66b361f4 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/extrude.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/extrude.h @@ -64,28 +64,29 @@ struct Identity_functor /** * \ingroup PMP_meshing_grp - * Extrudes the open mesh input and put the result in output. The mesh generated is a closed mesh with - * a bottom and top part, both having the same graph combinatoric as input(except that the orientation - * of the faces of the bottom part are reversed). The bottom and the top parts are connected by a - * triangle strip between each boundary cycles. The coordinates of the points associated to the + * extrudes the open surface mesh `input` and puts the result in `output`. The mesh generated is a closed + * surface mesh with a bottom and top part, both having the same graph combinatorics as `input` (except + * that the orientation of the faces of the bottom part is reversed). The bottom and the top parts are + * connected by a triangle strip between each boundary cycles. The coordinates of the points associated to the * vertices of the bottom and top part are first initialized to the same value as the corresponding - * vertices of input. Then for each vertex, a call to bot and top is done for the vertices of the + * vertices of `input`. Then for each vertex, a call to `bot` and `top` is done for the vertices of the * bottom part and the top part, respectively. - * @tparam InputMesh a model of the concept `FaceListGraph` - * @tparam OutputMesh a model of the concept `MutableFaceListGraph` + * @tparam InputMesh a model of `FaceListGraph` and `MutableFaceGraph` + * @tparam OutputMesh a model of `FaceListGraph` and `MutableFaceGraph` * @tparam NamedParameters1 a sequence of \ref pmp_namedparameters "Named Parameters" for `InputMesh` * @tparam NamedParameters2 a sequence of \ref pmp_namedparameters "Named Parameters" for `OutputMesh` * @tparam BottomFunctor a functor with a function - * `void operator()(boost::graph_traits::vertex_descriptor, - * boost::graph_traits::vertex_descriptor); - * @tparam TopFunctor a functor with a similar operator() as `BottomFunctor`. - * @param input the open triangulated `InputMesh` to extrude. + * `void operator()(boost::graph_traits::vertex_descriptor input_v,boost::graph_traits::vertex_descriptor output_v)` + * , where `output_v` is the copy of `input_v` into the bottom part. + * + * @tparam TopFunctor a functor with a an operator() similar to `BottomFunctor`. + * @param input the open `InputMesh` to extrude. * @param output the `OutputMesh` containing the result of the extrusion. * @param bot a `BottomFunctor` that will apply a transformation to all points of * `input` in order to create the first offsetted part of the extrusion. * @param top a `TopFunctor` that will apply a transformation to all points of * `input` in order to create the second offsetted part of the extrusion. - * @param np1 an optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below + * @param np_in an optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below * * \cgalNamedParamsBegin * \cgalParamBegin{vertex_point_map} @@ -94,7 +95,7 @@ struct Identity_functor * should be available for the vertices of `input` \cgalParamEnd * \cgalNamedParamsEnd * - * * @param np2 an optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below + * * @param np_out an optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below * * \cgalNamedParamsBegin * \cgalParamBegin{vertex_point_map} @@ -114,8 +115,8 @@ void generic_extrude_mesh(const InputMesh& input, OutputMesh& output, BottomFunctor& bot, TopFunctor& top, - const NamedParameters1& np1, - const NamedParameters2& np2) + const NamedParameters1& np_in, + const NamedParameters2& np_out) { typedef typename boost::graph_traits::vertex_descriptor input_vertex_descriptor; typedef typename boost::graph_traits::halfedge_descriptor input_halfedge_descriptor; @@ -128,9 +129,9 @@ void generic_extrude_mesh(const InputMesh& input, typedef typename GetVertexPointMap < OutputMesh, NamedParameters2>::type VPMap; typedef typename GetVertexPointMap < InputMesh, NamedParameters1>::const_type IVPMap; - VPMap output_vpm = choose_param(get_param(np2, internal_np::vertex_point), + VPMap output_vpm = choose_param(get_param(np_out, internal_np::vertex_point), get_property_map(vertex_point, output)); - IVPMap input_vpm = choose_param(get_param(np1, internal_np::vertex_point), + IVPMap input_vpm = choose_param(get_param(np_in, internal_np::vertex_point), get_const_property_map(vertex_point, input)); std::vector > bottom_v2v; @@ -169,7 +170,7 @@ void generic_extrude_mesh(const InputMesh& input, CGAL_assertion(is_border(offset_border_hedges.back(), output)); } } - // now create a quad strip + // now create a triangle strip for(std::size_t i=0; i< border_hedges.size(); ++i) { output_halfedge_descriptor h1 = border_hedges[i], h2=offset_border_hedges[i], @@ -212,32 +213,38 @@ void generic_extrude_mesh(const InputMesh& input, /** * \ingroup PMP_meshing_grp - * Fills `output` with a close mesh bounding the volume swept by `input` when translating its + * fills `output` with a close mesh bounding the volume swept by `input` when translating its * vertices by `dir` * `d`. The mesh is oriented so that the faces corresponding to `input` * in `output` have the same orientation. - * @tparam InputMesh a model of the concept `FaceListGraph` - * @tparam OutputMesh a model of the concept `FaceListGraph` + * @tparam InputMesh a model of the concept `MutableFaceGraph` + * @tparam OutputMesh a model of the concept `MutableFaceGraph` + * @tparam Vector_3 a type of Vector_3 from the kernel used by `OutputMesh`. + * @tparam FT a type of floating type from the kernel used by `OutputMesh`. * @tparam NamedParameters1 a sequence of \ref pmp_namedparameters "Named Parameters" for `InputMesh` * @tparam NamedParameters2 a sequence of \ref pmp_namedparameters "Named Parameters" for `OutputMesh` - * @param input the open triangulated `InputMesh` to extrude. + * @tparam InputMesh a model of `FaceListGraph` and `MutableFaceGraph` + * @tparam OutputMesh a model of `FaceListGraph` and `MutableFaceGraph` + * @param input the open `InputMesh` to extrude. * @param output the `OutputMesh` containing the result of the extrusion. - * @param np1 an optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below + * @param dir the vector defining the direction of the extrusion + * @param d the distance of the extrusion + * @param np_in an optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below * * \cgalNamedParamsBegin - * \cgalParamBegin{vertex_point_map} - * the property map that will contain the points associated to the vertices of `output`. - * If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` - * should be available for the vertices of `output` \cgalParamEnd - * \cgalNamedParamsEnd - * - * * @param np2 an optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below - * - * \cgalNamedParamsBegin - * \cgalParamBegin{vertex_point_map} - * the property map that contains the points associated to the vertices of `input`. + * \cgalParamBegin{vertex_point_map} + * the property map that contains the points associated to the vertices of `input`. * If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` * should be available for the vertices of `input` \cgalParamEnd * \cgalNamedParamsEnd + * + * * @param np_out an optional sequence of \ref pmp_namedparameters "Named Parameters" among the ones listed below + * + * \cgalNamedParamsBegin + * \cgalParamBegin{vertex_point_map} + * the property map that will contain the points associated to the vertices of `output`. + * If this parameter is omitted, an internal property map for `CGAL::vertex_point_t` + * should be available for the vertices of `output` \cgalParamEnd + * \cgalNamedParamsEnd */ template ::type::Vector_3 dir, const typename GetGeomTraits::type::FT d, #endif - const NamedParameters1& np1, - const NamedParameters2& np2) + const NamedParameters1& np_in, + const NamedParameters2& np_out) { typedef typename GetVertexPointMap < OutputMesh, NamedParameters2>::type VPMap; - VPMap output_vpm = choose_param(get_param(np2, internal_np::vertex_point), + VPMap output_vpm = choose_param(get_param(np_out, internal_np::vertex_point), get_property_map(vertex_point, output)); extrude_impl::Const_dist_translation< @@ -264,7 +271,7 @@ void extrude_mesh(const InputMesh& input, typename GetGeomTraits::type::Vector_3> bot(output_vpm, dir, d); extrude_impl::Identity_functor top; - generic_extrude_mesh(input, output, bot,top, np1, np2); + generic_extrude_mesh(input, output, bot,top, np_in, np_out); } //convenience overload template