Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] A Delaunay-Based Region Growing Algorithm

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] A Delaunay-Based Region Growing Algorithm


Chronological Thread 
  • From: sanlington <>
  • To: cgal-discuss <>
  • Subject: Re: [cgal-discuss] A Delaunay-Based Region Growing Algorithm
  • Date: Tue, 13 Oct 2009 21:54:13 +0800 (CST)

hi,
in three-dimensional triangulation, edge and facet are implicitly represented, you can access them by cell_handle and index . see the manual for details: "cgal_manual/TriangulationDS_3/Chapter_main.html"

Given a facet f, the cell_handle pointing to the cell which contains f as one of its four facets  is :
Cell_handle ch= f.first;
the index of f in a cell is : int index= f.second, it equals to the index of the vertex which opposite to f in that cell, so the indices of other three vertices of that cell are:
int i= (index+1)%4 ,
int j= (index+2)%4 ,
int k= (index+3)%4.

these three vertices are also the vertices of f, the three edges of f can be accessed like this:
Edge e0= Edge(ch,i,j);
Edge e1= Edge(ch,j,k);
Edge e2= Edge(ch,i,k).



在2009-10-13,"Josip Dzolonga" <> 写道:
But there is no function that just accepts a facet, I also need an edge and I can't see how to extract the edges from a facet. Should I go over all edges with finite_edges_begin and then see to which triangle facet belong?

2009/10/13 sanlington <>
hi,
do you mean you want to get the facets incident to the interested facet(triangle) ? if so, try the incident_facets(...) functions in Triangulation_3 class, they are also available in Delaunay_triangulation_3 class. (cgal_manual/Triangulation_3_ref/Class_Triangulation_3.html)
    Besides, if you transfer a facet to triangle,the neighbor information would be lost, so maybe you shoud "push_back" the facet, not the triangle, for the sequential neighborhood operation.


在2009-10-13,"Josip Dzolonga" <> 写道:

Dear all,

I have been recently introduced to CGAL, and I am using it to perform a Delaunay-Based Region Growing algorithm on an unorganized point cloud. The algorithm goes as follows

1) Compute the Delaunay triangulation (I am using the CGAL::Delaunay_triangulation_3 class) and add all facets to a list with the following code

// T - of type CGAL::Triangulation_hierarchy_3
// Triangle is from CGAL::Triangulation_hierarchy_3

for (Finite_facets_iterator iter = T.finite_facets_begin();
     iter != T.finite_facets_end(); iter++){          

    Triangle triangle = T.triangle(*iter);

    if (TrigPerimeter(triangle) < MAX_PERIMETER) // Skip over the big triangles
      triList->push_back(triangle);
    }
}

2) Choose a seed (the triangle with a vertex having the largest Z coordinate and the smallest circumdistance) and put in a priority queue Q where the priority is based on a heuristic
3) Take a triangle from Q and attach to it one of its best neighbours.

I have successfully done 1 and 2, however I am getting stuck on 3. Namely, as I am keeping all the triangles in a list of type list<Triangle>, I can't see how to get the neighbouring triangles of  some element in the list. I really tried to browse the manual, but can't find anything that might be helpful. Can you also point me to some relevant examples that do something similar to this? I tried the official examples but there was no access to neighbouring facets.

Thank you in advance,
Josip



09年新晋3D主流网游《天下贰》,网易六年亿资打造




网易历六年耗亿资打造,3D国韵网游《天下贰》,免费领光盘



Archive powered by MHonArc 2.6.16.

Top of Page