mirror of https://github.com/CGAL/cgal
named parameter
iterations -> nb_of_iterations inner_iterations -> nb_of_relaxations
This commit is contained in:
parent
ed053b5f2c
commit
fa81af898f
|
|
@ -29,13 +29,13 @@ See below a sample call of a function that uses the optional BGL named parameter
|
|||
// output : output polyhedron mesh
|
||||
// method : seed initialization method
|
||||
// num_proxies : number of proxies used to approximate the geometry
|
||||
// num_iterations : number of relaxation iterations
|
||||
// num_iterations : number of iterations after initialization
|
||||
// anchors : the container to store the anchor points
|
||||
vsa_mesh_approximation(input,
|
||||
, output
|
||||
, CGAL::VSA::parameters::init_method(method)
|
||||
.max_nb_proxies(num_proxies)
|
||||
.iterations(num_iterations)
|
||||
.nb_of_iterations(num_iterations)
|
||||
.anchor_points(std::back_inserter(anchors)));
|
||||
\endcode
|
||||
|
||||
|
|
@ -91,14 +91,14 @@ the minimum total error drop to approximate the input mesh.\n
|
|||
\b Default value is `0.01`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{iterations} \anchor VSA_iterations
|
||||
the number of iterations of relaxation after seeding.\n
|
||||
\cgalNPBegin{nb_of_iterations} \anchor VSA_nb_of_iterations
|
||||
the number of partitioning and fitting iterations after initialization.\n
|
||||
\b Type : `std::size_t` \n
|
||||
\b Default value is `10`
|
||||
\cgalNPEnd
|
||||
|
||||
\cgalNPBegin{inner_iterations} \anchor VSA_inner_iterations
|
||||
the number of iterations of relaxation interleaved within seeding.\n
|
||||
\cgalNPBegin{nb_of_relaxations} \anchor VSA_nb_of_relaxations
|
||||
the number of relaxations interleaved within initialization seeding.\n
|
||||
\b Type : `std::size_t` \n
|
||||
\b Default value is `10`
|
||||
\cgalNPEnd
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ int main()
|
|||
std::back_inserter(triangles),
|
||||
CGAL::VSA::parameters::init_method(CGAL::VSA::Hierarchical). // hierarchical init
|
||||
max_nb_proxies(200). // target number of proxies
|
||||
iterations(30). // number of relaxation iterations after seeding
|
||||
nb_of_iterations(30). // number of iterations after initialization
|
||||
// output to polyhedron
|
||||
output_mesh(&output)); // valid only if the indexed triangles construct a 2-manifold and oriented surface
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ int main()
|
|||
fpxmap, // output indexed face set
|
||||
CGAL::VSA::parameters::init_method(CGAL::VSA::Hierarchical). // hierarchical init
|
||||
max_nb_proxies(200). // refine until target number of proxies
|
||||
iterations(30)); // number of relaxation iterations after seeding
|
||||
nb_of_iterations(30)); // number of iterations after initialization
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ CGAL_add_named_parameter(geom_traits_t, geom_traits, geom_traits)
|
|||
CGAL_add_named_parameter(init_method_t, init_method, init_method)
|
||||
CGAL_add_named_parameter(max_nb_proxies_t, max_nb_proxies, max_nb_proxies)
|
||||
CGAL_add_named_parameter(min_error_drop_t, min_error_drop, min_error_drop)
|
||||
CGAL_add_named_parameter(iterations_t, iterations, iterations)
|
||||
CGAL_add_named_parameter(inner_iterations_t, inner_iterations, inner_iterations)
|
||||
CGAL_add_named_parameter(nb_of_iterations_t, nb_of_iterations, nb_of_iterations)
|
||||
CGAL_add_named_parameter(nb_of_relaxations_t, nb_of_relaxations, nb_of_relaxations)
|
||||
CGAL_add_named_parameter(mesh_chord_error_t, mesh_chord_error, mesh_chord_error)
|
||||
|
||||
// output parameters
|
||||
|
|
|
|||
|
|
@ -52,9 +52,9 @@ namespace VSA {
|
|||
* \cgalParamEnd
|
||||
* \cgalParamBegin{min_error_drop} minimum error drop of the approximation, expressed in ratio between two iterations of proxy addition.
|
||||
* \cgalParamEnd
|
||||
* \cgalParamBegin{iterations} number of relaxation iterations after seeding.
|
||||
* \cgalParamBegin{nb_of_iterations} number of partitioning and fitting iterations after initialization.
|
||||
* \cgalParamEnd
|
||||
* \cgalParamBegin{inner_iterations} number of relaxation iterations during seeding.
|
||||
* \cgalParamBegin{nb_of_relaxations} number of relaxations interleaved within initialization seeding.
|
||||
* \cgalParamEnd
|
||||
* \cgalParamBegin{mesh_chord_error} maximum chord approximation error use for mesh construction.
|
||||
* \cgalParamEnd
|
||||
|
|
@ -104,16 +104,16 @@ bool mesh_approximation(const TriangleMesh &tm_in,
|
|||
get_param(np, internal_np::max_nb_proxies), boost::optional<std::size_t>());
|
||||
boost::optional<FT> min_error_drop = choose_param(
|
||||
get_param(np, internal_np::min_error_drop), boost::optional<FT>());
|
||||
std::size_t inner_iterations = choose_param(get_param(np, internal_np::inner_iterations), 5);
|
||||
approx.init(method, max_nb_proxies, min_error_drop, inner_iterations);
|
||||
std::size_t nb_of_relaxations = choose_param(get_param(np, internal_np::nb_of_relaxations), 5);
|
||||
approx.init(method, max_nb_proxies, min_error_drop, nb_of_relaxations);
|
||||
|
||||
const std::size_t iterations = choose_param(get_param(np, internal_np::iterations), 10);
|
||||
approx.run(iterations);
|
||||
const std::size_t nb_of_iterations = choose_param(get_param(np, internal_np::nb_of_iterations), 10);
|
||||
approx.run(nb_of_iterations);
|
||||
|
||||
#ifdef CGAL_SURFACE_MESH_APPROXIMATION_DEBUG
|
||||
std::cout << "#px = " << approx.get_proxies_size()
|
||||
<< ", #itr = " << iterations
|
||||
<< ", #inner_itr = " << inner_iterations << std::endl;
|
||||
<< ", #itr = " << nb_of_iterations
|
||||
<< ", #relx = " << nb_of_relaxations << std::endl;
|
||||
#endif
|
||||
|
||||
typedef typename boost::lookup_named_param_def<
|
||||
|
|
|
|||
|
|
@ -45,22 +45,22 @@ namespace VSA {
|
|||
* \cgalParamBegin{geom_traits} a geometric traits class instance, model of `Kernel`.
|
||||
* Exact constructions kernels are not supported by this function.
|
||||
* \cgalParamEnd
|
||||
* \cgalParamBegin{vertex_point_map} the property map with the points associated
|
||||
* \cgalParamBegin{vertex_point_map} property map with the points associated
|
||||
* to the vertices of `tm_in`. Instance of a class model of `ReadWritePropertyMap`.
|
||||
* \cgalParamEnd
|
||||
* \cgalParamBegin{init_method} the selection of seed initialization method.
|
||||
* \cgalParamBegin{init_method} selection of seed initialization method.
|
||||
* \cgalParamEnd
|
||||
* \cgalParamBegin{max_nb_proxies} the maximum number of proxies is reached.
|
||||
* \cgalParamBegin{max_nb_proxies} maximum number of proxies to approximate the geometry.
|
||||
* \cgalParamEnd
|
||||
* \cgalParamBegin{min_error_drop} the minimum error drop of the approximation.
|
||||
* \cgalParamBegin{min_error_drop} minimum error drop of the approximation.
|
||||
* \cgalParamEnd
|
||||
* \cgalParamBegin{iterations} the relaxation iterations after seeding.
|
||||
* \cgalParamBegin{nb_of_iterations} number of partitioning and fitting iterations after initialization.
|
||||
* \cgalParamEnd
|
||||
* \cgalParamBegin{inner_iterations} the relaxation iterations when seeding.
|
||||
* \cgalParamBegin{nb_of_relaxations} number of relaxations interleaved within initialization seeding.
|
||||
* \cgalParamEnd
|
||||
* \cgalParamBegin{face_proxy_map} a property map containing the assigned proxy index of each face of `tm_in`
|
||||
* \cgalParamBegin{face_proxy_map} property map containing the assigned proxy index of each face of `tm_in`
|
||||
* \cgalParamEnd
|
||||
* \cgalParamBegin{proxies} the plane proxies
|
||||
* \cgalParamBegin{proxies} output iterator over proxies
|
||||
* \cgalParamEnd
|
||||
* \cgalNamedParamsEnd
|
||||
*/
|
||||
|
|
@ -96,16 +96,16 @@ void mesh_segmentation(const TriangleMesh &tm_in,
|
|||
get_param(np, internal_np::max_nb_proxies), boost::optional<std::size_t>());
|
||||
boost::optional<FT> min_error_drop = choose_param(
|
||||
get_param(np, internal_np::min_error_drop), boost::optional<FT>());
|
||||
std::size_t inner_iterations = choose_param(get_param(np, internal_np::inner_iterations), 5);
|
||||
approx.init(method, max_nb_proxies, min_error_drop, inner_iterations);
|
||||
std::size_t nb_of_relaxations = choose_param(get_param(np, internal_np::nb_of_relaxations), 5);
|
||||
approx.init(method, max_nb_proxies, min_error_drop, nb_of_relaxations);
|
||||
|
||||
const std::size_t iterations = choose_param(get_param(np, internal_np::iterations), 10);
|
||||
approx.run(iterations);
|
||||
const std::size_t nb_of_iterations = choose_param(get_param(np, internal_np::nb_of_iterations), 10);
|
||||
approx.run(nb_of_iterations);
|
||||
|
||||
#ifdef CGAL_SURFACE_MESH_APPROXIMATION_DEBUG
|
||||
std::cout << "#px = " << approx.get_proxies_sizes()
|
||||
<< ", #itr = " << iterations
|
||||
<< ", #inner_itr = " << inner_iterations << std::endl;
|
||||
<< ", #itr = " << nb_of_iterations
|
||||
<< ", #relx = " << nb_of_relaxations << std::endl;
|
||||
#endif
|
||||
|
||||
approx.get_proxy_map(segment_ids);
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ int main()
|
|||
std::back_inserter(points),
|
||||
std::back_inserter(triangles),
|
||||
CGAL::VSA::parameters::max_nb_proxies(6).
|
||||
iterations(30).
|
||||
inner_iterations(5).
|
||||
nb_of_iterations(30).
|
||||
nb_of_relaxations(5).
|
||||
mesh_chord_error(0.5).
|
||||
facet_proxy_map(fpxmap).
|
||||
anchor_vertices(std::back_inserter(anchors)).
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ int test() {
|
|||
CGAL::internal_np::vsa_no_output,
|
||||
CGAL::internal_np::vsa_no_output,
|
||||
CGAL::VSA::parameters::max_nb_proxies(6).
|
||||
iterations(30).
|
||||
inner_iterations(5).
|
||||
nb_of_iterations(30).
|
||||
nb_of_relaxations(5).
|
||||
mesh_chord_error(0.5).
|
||||
output_mesh(&out_mesh));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue