Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] triangulate a half sphere

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] triangulate a half sphere


Chronological Thread 
  • From: "Laurent Rineau (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] triangulate a half sphere
  • Date: Wed, 20 Oct 2010 17:12:19 +0200
  • Organization: GeometryFactory

Le mercredi 20 octobre 2010 16:39:30, Rolf Wester a écrit :
> Hi,
>
> I'm totally new to CGAL and as CGAL is quite a big library I'm a little bit
> lost in the CGAL universe.
>
> I would like to triangulate a half sphere and get the vertices and cells. I
> modified the triangulating a sphere example:
>
> FT sphere_function (Point_3 p) {
> const FT x2=p.x()*p.x(), y2=p.y()*p.y(), z2=p.z()*p.z();
> if(z2 < 0.0) return 0.0; // added this line
> return x2+y2+z2-1;
> }

z2 cannot be <0, because it is the square of a number. What is more, you must
return a stritcly positive number for the outside of your object. I suggest:

if(p.z() < 0) return 1.;

And the mesh methods in CGAL-3.7 are only for smooth objects. The mesh will
not be very acurate around the big circle x^2+y^2=0, z=0.

--
Laurent Rineau, PhD
Release Manager of the CGAL Project http://www.cgal.org/
R&D Engineer at GeometryFactory http://www.geometryfactory.com/



Archive powered by MHonArc 2.6.16.

Top of Page