Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] 3D regular triangulation output cell indices from finite facets

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] 3D regular triangulation output cell indices from finite facets


Chronological Thread 
  • From: Olivier Devillers <>
  • To:
  • Subject: Re: [cgal-discuss] 3D regular triangulation output cell indices from finite facets
  • Date: Thu, 10 Sep 2015 08:57:00 +0200



Le 10/09/15 08:22, Andreas Fabri a écrit :


Hello,

Cells have no (integer) index.  You can get a Cell_handle,
which is a kind of pointer to a cell.
A facet is a std::pair<Cell_handle,int>.
So if  you have a facet f,   f.first gives you the cell handle.
Note that the cell handle of a finite facet is not necessarily f.first->neighbor(f.second) is the other


a finite cell.

Best,

Andreas



On 10/09/2015 00:02, zyang wrote:
Hi friends,

I am new to CGAL and would really appreciate some help with 3D regular
triangulation -- to get output of cell indices from finite facets.

I have a test problem with five weighted points (with equal weights 1)
5
2 2 0 1
0 0 0 1
1 1 1.41421 1
2 0 0 1
0 2 0 1

I insert them one at a time to the triangulation, like this:
    Point p(x,y,z);
    Weight w = wt;
    P.push_back(Weighted_point(p, w));   
    Traits::Weighted_point wp=  Weighted_point(p, w);
    Vertex_handle v = T.insert(wp);
    v->info()= i+1;

Now I want to output the indices of the two cells sharing each finite facet.
Here is what I did to get the vertices of each facet. (took from an earlier
post)
   int nff = 0, k1;
   for(Rt::Finite_facets_iterator fit = T.finite_facets_begin();
      fit != T.finite_facets_end(); ++fit) {
      nff++;
     for(k1=1;k1<=3;k1++) {
        std::cout << nff << ' ' << fit->first->vertex( (fit->second+k1)%4
)->info() << ' ' ;
    }
    std::cout << std::endl;
   }

The problem is how to get the two cell indices from each facet.

Could someone help me with this?
Thanks in advance,
Zhibing







--
View this message in context: http://cgal-discuss.949826.n4.nabble.com/3D-regular-triangulation-output-cell-indices-from-finite-facets-tp4661135.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



--
Olivier Devillers, chercheur à

PNG image




Archive powered by MHonArc 2.6.18.

Top of Page