From 41d5657f072dd2ffa9196050a7e8d0a5fd59d288 Mon Sep 17 00:00:00 2001 From: Nicolas Saillant Date: Thu, 8 Aug 2024 15:03:43 +0200 Subject: [PATCH] . --- ...esh_registration_example_8cpp-example.html | 33 ++++--------------- .../group__PMP__registration__grp.html | 22 ++++++------- .../Polygon_mesh_processing/index.html | 33 ++++--------------- 3 files changed, 23 insertions(+), 65 deletions(-) diff --git a/build_doc/doc_output/Polygon_mesh_processing/Polygon_mesh_processing_2non_rigid_mesh_registration_example_8cpp-example.html b/build_doc/doc_output/Polygon_mesh_processing/Polygon_mesh_processing_2non_rigid_mesh_registration_example_8cpp-example.html index 0691556e9abc..b6ead84fc685 100644 --- a/build_doc/doc_output/Polygon_mesh_processing/Polygon_mesh_processing_2non_rigid_mesh_registration_example_8cpp-example.html +++ b/build_doc/doc_output/Polygon_mesh_processing/Polygon_mesh_processing_2non_rigid_mesh_registration_example_8cpp-example.html @@ -212,14 +212,9 @@
std::vector<std::pair<Mesh::Vertex_index, Mesh::Vertex_index>> correspondences_mesh;
std::ifstream corr(corr_fn);
if (corr.is_open()) {
-
std::string line;
-
while (std::getline(corr, line)) {
-
if (line.size() == 0) continue;
-
std::istringstream iss(line);
-
-
std::size_t v0, v1;
-
if (iss >> v0 >> v1)
-
Mesh source, target;
+
std::size_t v0, v1;
+
while (corr >> v0 >> v1) {
+
std::cout << v0 << " " << v1 << std::endl;
correspondences_mesh.push_back(std::make_pair(*(source.vertices_begin() + v0), *(target.vertices_begin() + v1)));
}
@@ -230,28 +225,12 @@
if (vnm.second)
PMP::compute_vertex_normals(target, vnm.first);
-
typename Mesh::Property_map<Mesh::Vertex_index, CGAL::Aff_transformation_3<K>> vrm = source.add_property_map<Mesh::Vertex_index, CGAL::Aff_transformation_3<K>>("v:rotation").first;
-
typename Mesh::Property_map<Mesh::Vertex_index, K::Vector_3> vtm = source.add_property_map<Mesh::Vertex_index, K::Vector_3>("v:transformations").first;
-
-
/*
-
CGAL::Point_set_3<K::Point_3> points;
-
points.reserve(target.num_vertices());
-
-
for (auto v : target.vertices())
-
points.insert(target.point(v), get(vnm.first, v));
-
-
std::vector<std::pair<Mesh::Vertex_index, std::size_t>> correspondences_pts;
-
correspondences_pts.reserve(correspondences_mesh.size());
-
for (auto p : correspondences_mesh)
-
correspondences_pts.push_back(std::make_pair(p.first, static_cast<std::size_t>(p.second)));
-
-
PMP::non_rigid_mesh_to_points_registration(source, points, vtm, vrm, correspondences_pts, CGAL::parameters::point_to_plane_energy(2.0).point_to_point_energy(0.1).as_rigid_as_possible_energy(10));
-
PMP::apply_non_rigid_transformation(source, vtm, vrm);
-
CGAL::IO::write_polygon_mesh("mapped.off", source);*/
+
Mesh::Property_map<Mesh::Vertex_index, CGAL::Aff_transformation_3<K>> vrm = source.add_property_map<Mesh::Vertex_index, CGAL::Aff_transformation_3<K>>("v:rotation").first;
+
Mesh::Property_map<Mesh::Vertex_index, K::Vector_3> vtm = source.add_property_map<Mesh::Vertex_index, K::Vector_3>("v:translation").first;
FT w1 = 1.0;
FT w2 = 2.0;
-
FT w3 = 5000000;
+
FT w3 = 500;
PMP::non_rigid_mesh_to_mesh_registration(source, target, vtm, vrm, correspondences_mesh, CGAL::parameters::point_to_point_energy(w1).point_to_plane_energy(w2).as_rigid_as_possible_energy(w3));
PMP::apply_non_rigid_transformation(source, vtm, vrm);
diff --git a/build_doc/doc_output/Polygon_mesh_processing/group__PMP__registration__grp.html b/build_doc/doc_output/Polygon_mesh_processing/group__PMP__registration__grp.html index dd70817f6810..74bbb7f8f27f 100644 --- a/build_doc/doc_output/Polygon_mesh_processing/group__PMP__registration__grp.html +++ b/build_doc/doc_output/Polygon_mesh_processing/group__PMP__registration__grp.html @@ -346,8 +346,8 @@

sourcethe triangle mesh that should be mapped onto target targetthe target triangle mesh - vtma writeable vertex property map of source to store the translation vector of the registration - vrma writeable vertex property map of source to store the rotation part of the registration + vtma writable vertex property map of source to store the translation vector of the registration + vrma writable vertex property map of source to store the rotation part of the registration np1an optional sequence of Named Parameters1 of the source and the method among the ones listed below np2an optional sequence of Named Parameters2 of the target providing a vertex point map and a vertex normal map correspondencesa vector given matching points between the source and the target @@ -396,7 +396,7 @@

as_rigid_as_possible_energy