Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Mesh 2D test

Subject: CGAL users discussion list

List archive

[cgal-discuss] Mesh 2D test


Chronological Thread 
  • From: N2a <>
  • To:
  • Subject: [cgal-discuss] Mesh 2D test
  • Date: Fri, 26 Mar 2010 02:55:05 -0800 (PST)


Hello,
I was making tests on the mesh 2D generation and I have 2 things I do not
understand.
I run a constrained triangulation on a non convex hull. The boundary is
constrained.

Problem 1: I iterate over FINITE faces and when I print the vertex index for
each one I get three faces (over more than 1000) with the infinite vertex 0.
Problem 2: Each triangle have a positive signed area. I want to isolate the
mesh from the triangulated part. Do I miss something in the boundary
orientation?

Thank You in advance,
Benjamin

Here is the a piece of code:
Declaration are the ones of the mesh_global.cpp example.

std::map<Vertex_handle,int> vertex_index;
int idx = 0;
int nn=cdt.number_of_vertices();
std::vector<Vertex_handle> TV(nn);
int ii=0;
for(CDT::Vertex_iterator vit=cdt.vertices_begin(); vit !=
cdt.vertices_end(); ++vit)
{
vertex_index[vit]=idx++;
TV[ii++]=vit;
}

for (i=1; i<= nn-1; ++i)
{
output << TV[i]->point() << std::endl;
}

for(CDT::Finite_faces_iterator fit=cdt.finite_faces_begin(); fit !=
cdt.finite_faces_end(); ++fit)
{
int i0 = vertex_index[fit->vertex(0)];
int i1 = vertex_index[fit->vertex(1)];
int i2 = vertex_index[fit->vertex(2)];
output << i0 << " "<< i1 << " " << i2 << " " ;

Triangle_2 Tri_2(TV[i0]->point(),TV[i1]->point(),TV[i2]->point());
output2 << Tri_2.area() << std::endl;
}
--
View this message in context:
http://n4.nabble.com/Mesh-2D-test-tp1691990p1691990.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.16.

Top of Page