Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Surface_mesher parameters

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Surface_mesher parameters


Chronological Thread 
  • From: Ricardo Uribe Lobello <>
  • To:
  • Subject: Re: [cgal-discuss] Surface_mesher parameters
  • Date: Wed, 13 Apr 2011 17:55:30 +0200
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; b=X+oFp5U2F28HQ8hlAxUPnZAFLG5GCsP9FbeKM8gFssqx7lqflja7kGHFnXujIN1qFS OOUM8JlpLGbCxWL1sMAsIMbFLQ3HFyf+SQLbOtdvAIYyBZrPJ0X4splqmqqKgM+7cf/v +/eEA2Bo0i+UyiY/Lq1CY48mtKuHqi/n/kXxc=

On 13/04/2011 09:14, Laurent Rineau (GeometryFactory) wrote:
Le lundi 11 avril 2011 13:57:11, Ricardo Uribe Lobello a écrit :
Good morning,

I am trying to use the Surface_mesher examples in CGAL 3.7 in order to
extract an surface from
a set of images in format raw. I used the CGALIO program to generate a
file .inr and i execute the
Surface_mesher but i always obtain only one part of the volume.
Apparently it has to do with the parameters of the sphere that has to
enclose the object and the
Surface_mesh_default_criteria_3 trait.

The volume dimentions are 1024 x 1024 x 1024 and the spacing is (1,2,1).
The origin is (0,0,0) someone can explain me which are the good
parameters for the surface_mesher in this case?
Use (512, 1024, 512) as the center of the sphere, and
r2 = 512^2+1024^2+512^2+1 = 1572865
as squared radius of the sphere.


Hello,

I have tried with the parameters that you gave me but i got the same result, only one part
of the volume is meshed. I include the code of the main that i am using. This is simply a modification
of the Surface_mesher example. I have already generated surfaces using this code as template over
other volumes. Could someone take a look at it?

Thanks in advance,
Ricardo

Code ------>

// default triangulation for Surface_mesher
typedef CGAL::Surface_mesh_default_triangulation_3 Tr;

// c2t3
typedef CGAL::Complex_2_in_triangulation_3<Tr> C2t3;

typedef Tr::Geom_traits GT;
typedef CGAL::Gray_level_image_3<GT::FT, GT::Point_3> Gray_level_image;
typedef CGAL::Implicit_surface_3<GT, Gray_level_image> Surface_3;

int main() {
Tr tr; // 3D-Delaunay triangulation
C2t3 c2t3 (tr); // 2D-complex in 3D-Delaunay triangulation

// the 'function' is a 3D gray level image
Gray_level_image image("Buddha_1024_1024_1024.inr", 1);

// Carefully choosen bounding sphere: the center must be inside the
// surface defined by 'image' and the radius must be high enough so that
// the sphere actually bounds the whole image.
GT::Point_3 bounding_sphere_center(512., 1024., 512.);
GT::FT bounding_sphere_squared_radius = 512*512+1024*1024+512*512+1.;
GT::Sphere_3 bounding_sphere(bounding_sphere_center,
bounding_sphere_squared_radius);

// definition of the surface, with 10^-5 as relative precision
Surface_3 surface(image, bounding_sphere, 1e-5);

// defining meshing criteria
CGAL::Surface_mesh_default_criteria_3<Tr> criteria(30.,
5.,
5.);

// meshing surface, with the "manifold without boundary" algorithm
CGAL::make_surface_mesh(c2t3, surface, criteria, CGAL::Manifold_tag());

std::ofstream out("CGALBuddha.off");
CGAL::output_surface_facets_to_off (out, c2t3);
std::cout << "Final number of points: " << tr.number_of_vertices() << "\n";
}
------>




Archive powered by MHonArc 2.6.16.

Top of Page