Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Triangulation on sphere, taking sphere's surface facets

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Triangulation on sphere, taking sphere's surface facets


Chronological Thread 
  • From: "Laurent Rineau (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Triangulation on sphere, taking sphere's surface facets
  • Date: Wed, 30 Jun 2010 10:30:23 +0200
  • Organization: GeometryFactory

Hi Damien,

On Wednesday 30 June 2010 10:03:22 dada_bx wrote:
> Hi all,
>
> I test the 3D surface mesh generation with this sample code :
> http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Surface_mesher/Chapter_
> main.html#figure:Surface_mesher-sphere-surface sphere mesh generation
>
> I run an custom openGl 3D viewer to show the result.
> First, i transpose facet in triangle_3 like this:
>
> Tr::Finite_facets_iterator it_facet;
> for (it_facet = tr.finite_facets_begin(); it_facet !=
> tr.finite_facets_end(); it_facet++)
> {

Here in the code, insert that line:

// skip facets that are not in the C2t3 complex.
if(!c2t3.is_in_complex(*it_facet) continue;

Where c2t3 is the 2D complex in 3D triangulation that is the result of the
mesh generation (the triangulation is only a support of the mesh, but not the
real mesh).

> GT::Triangle_3 t (tr.triangle(*it_facet));
> //... routine to save triangle_3 in stl container
> }

You can also use the facets iterators of the c2t3 itself.
c2t3.facets_begin ();
c2t3.facets_end ();
Their type is C2t3::Facet_iterator.

C2t3::Facet_iterator if_facet;
for (it_facet = c2t3.facets_begin();
it_facet != c2t3.facets_end(); ++it_facet)
{
GT::Triangle_3 t (tr.triangle(*it_facet));
//... routine to save triangle_3 in stl container
}

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



Archive powered by MHonArc 2.6.16.

Top of Page