Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Help with make_surface_mesh

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Help with make_surface_mesh


Chronological Thread 
  • From: Tony Apicella <>
  • To: "" <>
  • Subject: Re: [cgal-discuss] Help with make_surface_mesh
  • Date: Mon, 4 Jan 2021 18:55:39 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epmap-system.com; dmarc=pass action=none header.from=epmap-system.com; dkim=pass header.d=epmap-system.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9fmBn/bzelsIfDny3QAsaIpi5F70IHMWvKB2jWVBhmU=; b=ZuYOeA0hu//uYJxDd9iFUcjEtGYXnl87USEuFHQyUKt6u9rol/gvI/TLvS9gDKUaC48snal/bm3Wu94T477kWlGeY7L68CPBn57z0jdqvAXtob3SmwOQQmr9wlPdGbmwS9qBi5R261sMFd5hfaWYXEl15k6IKl4E5ywl3xfuzMyJK8rzKwmJuXUQp/W6qXXohp/XiBr6hSmKIikq3Bkkmvi1rrDu2I07/FO7jgSEOCQ4pYJh0VtY3p/q6wk9XEIh8nsJMO+r/q8Wn5HQnS0UJR3ug2oT2tLZFYplw1RY7duIreMNsYviZS3oJZCC5ggsWftNJkOIuixZntN4DlYQ6g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NwtcZQ62NB0dNgwlBbsTCTraQ6dKLoP12eZYfTDHs00uJ5YzxUnyEu9CcYVreRTsTL3dKFzYOIVADRz9E2RMNfFDynanS20sNXohQTzVdHlthfWiDf57BxarnpQ2m0FvB7wLdT9/wHBoBB37XZbDOAn8biXQ7HIZQkVQTEZGRSWwx51FGV7KSespAIfBsKb/NPxZ2MlGp1PuQxAd/YqbqzpEwjVz0z7/fr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CMV5JZAiIgonsNl7VPfz0EfKyjlSpnTpu2vzLPrvsCYjXIHfZirfuZ7N95lZcyAUtydBf4IpZBL8OLv39RkP9qcXUAB8lPQCq2urnD85y2Z0EVWKIH6+ZLLjdsViV5uIpPuaAfpcVuCz6K/g5+fHhkWM5mV4afamvx5cXb224HuhiI0WeZnrsgc0NHnsNvgo7VODqiVuCXiBPZ3uqUK8w+is3BJ+6AYrBXIyhnbKM0SehEpBWZm1KElWMHm3pd4WAVfcMciWSIsp5nzwYUrihTY8g2gu2tA/717VoMO7U+ikCup/4ytd1/+jTmgsq9TBtFMSc03qNT31qkWMNXTM5wKd/oUllxleZzad4m+BYFcBU5/5RTgg6OoTTz+hjB9/vWwLBZcuGSEu9QtW9GjwxVdIww9oWY0lnAdmijxbD3zCrA7APjbCLCoY0oerh2WPsLZN912rez/tmyEI3R9NGc2ygnK92sQbJQJXYll2Q0Kese6Nb1yHE8CKPzHGFoVpDAzN2SrjPfWwaYh7Wscjh/RGFCKS/DKwudApH08+LbKVQLcb4iE1PA/blNtOZaG24nyK8BA2D26iXP7fsYHgX4CjNFB0EjxwL5iTBchMvAz+o5WPYFj1nU1z1JFj99PF373K9QEhzxA6Dawht1qG+5wUO1sCbHrkY0bsA/SsgsD5pB02V3tTMCtPGqRArNPFXbto5pVtGzmnErBdVP5q6LqkkiERIICptuEa76xJxG81pickhoXcuxUImNaWewVpZdjiV2ZT5ErDPL2DquQu+cLLb3xfV19PAqfRH0+gxt1i25FLhLUEl6Xgyi4AJgUvZ3Y3DCU8paby0Slw+rkgoqqnfazF4/JLPyXBpd6Kzt22ago97NK4e0h+lOuxnHuaEGQv1T5JIK+WTcLVvtWLzKxUOMaZV6bI+ON6ge72ewqm3Me18nTWgy2Na/IR61UHK/C15GLeRjsQ1hsqA1w7CbA/SyVKos8T5g4dBPGFAE3K6wDChH59KeqB3O40MDDX3Lg==

Thank you Sebastien.
I did update the radius each time.  But it was updated incorrectly.  The argument to the Sphere_3 class constructor is the square of the radius, but I used only the radius.




From: <> on behalf of Sebastien Loriot <>
Sent: Monday, January 4, 2021 9:19 AM
To: <>
Subject: Re: [cgal-discuss] Help with make_surface_mesh
 
Did you update the radius of the bounding sphere each time?


Sebastien.


On 1/4/21 5:42 PM, Tony Apicella wrote:
>
>
> I simulated a gray scale volume of 32x32x32 voxels with a solid sphere
> of radius 8.
>
> make_surface_mesh produces a mesh only over a portion of the sphere.
>
>
>
> If I simulate a sphere with a smaller radius, then make_surface_mesh
> produces a mesh around the entire sphere.
>
>
>
> If I simulate a sphere of radius 12, then make_surface_mesh takes a
> very long time, I did not wait for it to complete.
>
> Here is the code I used.  One INR volume of the sphere having radius 8
> is attached.
>
>
> Thank you.
>
> #include <iostream>
>
> main()
> {
>
> string path("-----somewhere------------");
> name = "sphere4";
> string file = path + name;
> file += ".INR";
>
> Tr tr;            // 3D-Delaunay triangulation
> C2t3 c2t3(tr);   // 2D-complex in 3D-Delaunay triangulation
>
> // the 'function' is a 3D gray level image
> std::cout << "Reading INR: " << file << std::endl;
> float thresh = 2.9f;
> Gray_level_image image( file.c_str(), thresh );
> std::cout << "Completed reading INR with threshold" << thresh <<
> std::endl;
>
> // Carefully chosen 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.
> float xspan = float(image.xdim() * image.vx());
> float yspan = float(image.ydim() * image.vy());
> float zspan = float(image.zdim() * image.vz());
> GT::Point_3 bounding_sphere_center(xspan / 2, yspan / 2, zspan / 2);
>
> float span = sqrt(xspan * xspan + yspan * yspan + zspan * zspan);
>
> GT::FT bounding_sphere_squared_radius = span;
> GT::Sphere_3 bounding_sphere(bounding_sphere_center,
> bounding_sphere_squared_radius);
>
> // definition of the surface, with relative precision
> std::cout << "Define surface" << std::endl;
> Surface_3 surface(image, bounding_sphere, 1e-2);
>
> // defining meshing criteria
> std::cout << "Defining mesh criteria" << std::endl;
> // defining meshing criteria
> CGAL::Surface_mesh_default_criteria_3<Tr> criteria(30.0f, 0.5f, 1.414f);
>
> // meshing surface, with the "manifold without boundary" algorithm
> std::cout << "Making mesh" << std::endl;
> CGAL::make_surface_mesh(c2t3, surface, criteria,
> CGAL::Non_manifold_tag());
>
> file = path + name;
> file += ".off";
> std::cout << "Writing to " << file << endl;
>
> std::ofstream out(file);
> CGAL::output_surface_facets_to_off(out, c2t3);
> std::cout << "Final number of points: " << tr.number_of_vertices() <<
> "\n";
>
> }
>
>
>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
>

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss





Archive powered by MHonArc 2.6.19+.

Top of Page