From 5a1b82e583e2421da42e97c7c74a2654d80920fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 31 Jan 2014 11:24:23 +0100 Subject: [PATCH] explicit deform could be called several time to reach convergence --- Surface_modeling/doc/Surface_modeling/Surface_modeling.txt | 5 +++-- .../examples/Surface_modeling/all_roi_assign_example.cpp | 5 +++-- .../all_roi_assign_example_custom_polyhedron.cpp | 3 ++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Surface_modeling/doc/Surface_modeling/Surface_modeling.txt b/Surface_modeling/doc/Surface_modeling/Surface_modeling.txt index 8139fdc050d..93e09a449ff 100644 --- a/Surface_modeling/doc/Surface_modeling/Surface_modeling.txt +++ b/Surface_modeling/doc/Surface_modeling/Surface_modeling.txt @@ -109,7 +109,8 @@ varies depending on whether the user chose a fixed number of iterations or a sto After the call to the deformation function, the input mesh is updated and the control vertices are at their target positions and the free vertices are moved accordingly. -The function `Deform_mesh::deform()` can be called as many time as desired. +The function `Deform_mesh::deform()` can be called several times consecutively, in particular +if the convergence has not been reached yet (otherwise it has no effect). @@ -132,7 +133,7 @@ In this example, the whole mesh is used as ROI and a few vertices are added as c Deformation results when running example \ref Example_1 : `deform_1.off` and `deform_2.off`. \cgalFigureEnd -\subsubsection Example_2 Using Affine Transformation on Range of Vertices +\subsubsection Example_2 Using an Affine Transformation on a Range of Vertices In this example, we use the functions `translate()` and `rotate()` on a range of control vertices. \cgalExample{Surface_modeling/k_ring_roi_translate_rotate_example.cpp} diff --git a/Surface_modeling/examples/Surface_modeling/all_roi_assign_example.cpp b/Surface_modeling/examples/Surface_modeling/all_roi_assign_example.cpp index acb2da59d1b..064fa867831 100644 --- a/Surface_modeling/examples/Surface_modeling/all_roi_assign_example.cpp +++ b/Surface_modeling/examples/Surface_modeling/all_roi_assign_example.cpp @@ -83,9 +83,10 @@ int main() deform_mesh.set_target_position(control_1, constrained_pos_1); // note that we only assign a constraint for control_1, other control vertices will be constrained to last assigned positions - // deform the mesh, now positions of vertices of 'mesh' will be changed + // deform the mesh, now the positions of vertices of 'mesh' will be changed + deform_mesh.deform(); + // deform can be called several times if the convergence has not been reached yet deform_mesh.deform(); - deform_mesh.deform(); // you can call deform multiple times if you like Deform_mesh::Point constrained_pos_2(0.55, -0.30, 0.70); deform_mesh.set_target_position(control_2, constrained_pos_2); diff --git a/Surface_modeling/examples/Surface_modeling/all_roi_assign_example_custom_polyhedron.cpp b/Surface_modeling/examples/Surface_modeling/all_roi_assign_example_custom_polyhedron.cpp index 87a8b184920..ff102aa5232 100644 --- a/Surface_modeling/examples/Surface_modeling/all_roi_assign_example_custom_polyhedron.cpp +++ b/Surface_modeling/examples/Surface_modeling/all_roi_assign_example_custom_polyhedron.cpp @@ -122,7 +122,8 @@ int main() // deform the mesh, now positions of vertices of 'mesh' will be changed deform_mesh.deform(); - deform_mesh.deform(); // you can call deform multiple times if you like + // deform can be called several times if the convergence has not been reached yet + deform_mesh.deform(); Deform_mesh::Point constrained_pos_2(0.55, -0.30, 0.70); deform_mesh.set_target_position(control_2, constrained_pos_2);