a polygon mesh with triangulated surface patches to be smoothed.
faces
the range of triangular faces defining one or several surface patches to be smoothed.
time
a time step that corresponds to the speed by which the surface is smoothed. A larger time step results in faster convergence but details may be distorted to a larger extent compared to more iterations with a smaller step. Typical values scale in the interval (1e-6, 1].
np
an optional sequence of Named Parameters among the ones listed below
1>D:\CGAL\CGAL-5.4.1\include\CGAL/Polygon_mesh_processing/smooth_shape.h(149,1): error C2338: static_assert failed: 'Eigen3 version 3.2 or later is required.'
Smooth with both angle and area criteria + Delaunay flips,number_of_iterations=10.
问题与总结
进一步理解了可选命名参数vertex_is_constrained_map
Type: a class model of ReadWritePropertyMap with boost::graph_traits<TriangleMesh>::vertex_descriptor as key type and bool as value type. It must be default constructible.
Default: a default property map where no vertex is constrained
Extra: A constrained vertex cannot be modified at all during smoothing.
对于ReadWritePropertyMap的构造。
1 2 3 4 5 6
std::set<Mesh::Vertex_index> constrained_vertices; for (Mesh::Vertex_index v : vertices(mesh)) { if (is_border(v, mesh)) constrained_vertices.insert(v); }
/// \ingroup PkgPropertyMapRef /// Read-write property map turning a set (such a `std::set`, /// `boost::unordered_set`, `std::unordered_set`) into a property map /// associating a Boolean to the value type of the set. The function `get` will /// return `true` if the key is inside the set and `false` otherwise. The `put` /// function will insert an element in the set if `true` is passed and erase it /// otherwise. /// \cgalModels `ReadWritePropertyMap` template<classSet> structBoolean_property_map { typedeftypename Set::value_type key_type; typedefbool value_type; typedefbool reference; typedef boost::read_write_property_map_tag category;
Set* set_ptr; /// Constructor taking a copy of the set. Note that `set_` must be valid /// while the property map is in use. Boolean_property_map(Set& set_) : set_ptr(&set_) {} Boolean_property_map() : set_ptr(nullptr) {}
Type: a class model of ReadWritePropertyMap with boost::graph_traits<TriangleMesh>::vertex_descriptor as key type and bool as value type. It must be default constructible.