- change sligthly the code of examples, and modify sligthly the user manual

accordingly
This commit is contained in:
Laurent Rineau 2006-03-22 21:43:49 +00:00
parent 7bea6871e1
commit 71f51a264e
4 changed files with 25 additions and 13 deletions

View File

@ -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

View File

@ -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}

View File

@ -10,8 +10,6 @@ typedef CGAL::Surface_mesh_cell_base_3<Kernel> Cb;
typedef CGAL::Triangulation_data_structure_3<Vb, Cb> Tds;
typedef CGAL::Delaunay_triangulation_3<Kernel, Tds> Tr;
typedef CGAL::Surface_mesh_complex_2_in_triangulation_3<Tr> C2t3;
typedef Kernel::Sphere_3 Sphere_3;
typedef Kernel::Point_3 Point_3;
typedef CGAL::Gray_level_image_3<Kernel::FT> Gray_level_image;
typedef CGAL::Implicit_surface_3<Kernel, Gray_level_image> 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<Tr> criteria(30.,

View File

@ -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<Tr> criteria(30., //angular bound