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: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] triangulate a half sphere
  • Date: Wed, 20 Oct 2010 16:48:00 +0200

Rolf Wester wrote:
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.
Welcome Rolf,


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

I guess this is not the best way to do it. Besides this I couldn't find a way to get the vertices
and cells. Is there a documentation of all the classes and their respective methods?
you can use iterators provided by the complex_2_in_triangulation_3
documented here:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Surface_mesher_ref/Concept_SurfaceMeshComplex_2InTriangulation_3.html

c2t3.facets_begin(),c2t3.facets_end()
c2t3.vertices_begin(),c2t3.vertices_end()

Be aware of the fact that a facet is a pair<Cell_handle,int> where the
integer is the index (0 -> 3) of the vertex opposite to the facet.

documentation is here:
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/TriangulationDS_3_ref/Concept_TriangulationDataStructure_3.html#Cross_link_anchor_1338

S.


I would be very appreciative for your help.

Regards
Rolf





Archive powered by MHonArc 2.6.16.

Top of Page