diff --git a/Surface_mesher/changes.txt b/Surface_mesher/changes.txt index 6e0aa6e905a..1ff526a104c 100644 --- a/Surface_mesher/changes.txt +++ b/Surface_mesher/changes.txt @@ -8,6 +8,8 @@ Surface_mesher::refine_mesh. It is now template parameters of the class Surface_mesher. I have verified that the optimizer of GNU/CC is able to strip the debug code when NO_DEBUG is use. +- change sligthly the code of examples, and modify sligthly the user manual + accordingly 21 March 2006 Laurent Rineau - fix examples/Surface_mesher/3d_image_surface_mesher.C (stupid bug: the diff --git a/Surface_mesher/doc_tex/Surface_mesher/main.tex b/Surface_mesher/doc_tex/Surface_mesher/main.tex index dd4212a8be1..087eaa10e28 100644 --- a/Surface_mesher/doc_tex/Surface_mesher/main.tex +++ b/Surface_mesher/doc_tex/Surface_mesher/main.tex @@ -202,11 +202,15 @@ the automatically generated traits class In this example the surface to be meshed is defined as the locus of points with a given gray level in a 3D image. -The code is quite similar to the previous example, -except for the definition of the function -which is passed to the creator of the surface. -In this case, it is an instance of -the \ccc{CGAL::Gray_level_image_3} class. +The code is quite similar to the previous example. The parameters of the +surface creator are different: +\begin{itemize} +\item the function is an instance of the \ccc{CGAL::Gray_level_image_3} + class, +\item the bounding sphere is chosen carefully, so that its center is inside + the surface and the radius high enough to actually bound the definition + domain of the 3D image. +\end{itemize} \ccIncludeExampleCode{Surface_mesher/3d_image_surface_mesher.C} diff --git a/Surface_mesher/examples/Surface_mesher/3d_image_surface_mesher.C b/Surface_mesher/examples/Surface_mesher/3d_image_surface_mesher.C index dae8bbbc173..d8f4df9709f 100644 --- a/Surface_mesher/examples/Surface_mesher/3d_image_surface_mesher.C +++ b/Surface_mesher/examples/Surface_mesher/3d_image_surface_mesher.C @@ -10,8 +10,6 @@ typedef CGAL::Surface_mesh_cell_base_3 Cb; typedef CGAL::Triangulation_data_structure_3 Tds; typedef CGAL::Delaunay_triangulation_3 Tr; typedef CGAL::Surface_mesh_complex_2_in_triangulation_3 C2t3; -typedef Kernel::Sphere_3 Sphere_3; -typedef Kernel::Point_3 Point_3; typedef CGAL::Gray_level_image_3 Gray_level_image; typedef CGAL::Implicit_surface_3 Surface_3; @@ -20,11 +18,20 @@ int main(int, char **) { Tr tr; // 3D-Delaunay triangulation C2t3 c2t3 (tr); // 2D-complex in 3D-Delaunay triangulation - // defining the surface Gray_level_image image("ImageIO/data/skull_2.9.inr.gz", 2.9); - Surface_3 surface(image, - Sphere_3(Point_3(250., 250., 250.), 300.*300.*2.), - 1e-02); + + // bounding_sphere_center is a point inside the surface defined by image. + Kernel::Point_3 bounding_sphere_center(122., 102., 117.); + + // bounding_sphere_squared_radius is chosen so that the sphere bounds the + // whole image + Kernel::FT bounding_sphere_squared_radius = 200.*200.*2.; + + Kernel::Sphere_3 bounding_sphere(bounding_sphere_center, + bounding_sphere_squared_radius); + + // definition of the surface + Surface_3 surface(image, bounding_sphere, 1e-2); // defining meshing criteria CGAL::Surface_mesh_default_criteria_3 criteria(30., diff --git a/Surface_mesher/examples/Surface_mesher/implicit_surface_mesher.C b/Surface_mesher/examples/Surface_mesher/implicit_surface_mesher.C index 67fc4da1700..7f7dacc3507 100644 --- a/Surface_mesher/examples/Surface_mesher/implicit_surface_mesher.C +++ b/Surface_mesher/examples/Surface_mesher/implicit_surface_mesher.C @@ -25,8 +25,7 @@ int main(int, char **) { // defining the surface Surface_3 surface(sphere_function, // pointer to function - Sphere_3(CGAL::ORIGIN, 2.), // bounding sphere - 1e-03); // precision for intersections computations + Sphere_3(CGAL::ORIGIN, 2.)); // bounding sphere // defining meshing criteria CGAL::Surface_mesh_default_criteria_3 criteria(30., //angular bound