Skip to Content.
Sympa Menu

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

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Mesh 2D test


Chronological Thread 
  • From: "Laurent Rineau (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Mesh 2D test
  • Date: Fri, 26 Mar 2010 12:28:00 +0100
  • Organization: GeometryFactory

On Friday 26 March 2010 11:55:05 N2a wrote:
> 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.
[...]
>
> 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;
> }

Here you give an index to all vertices of the triangulation (including the
infinite one).

TV[0] is cdt.vertices_begin(). There is no reason that vertex is the infinite
one (you are iterating of finite vertices: vertex_begin() is a deprecated
name
for finite_vertices_begin()). Then, it is normal that a finite face can be
incident to that vertex numbered 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?

I do not really understand your question about the boundary orientation.

If "fit" is a handle (or iterator) to a facet, then "fit->is_in_domain()" is
true if and only if the facet is in the mesh domain (I assume that what you
call "the mesh" is what I call "the mesh domain").

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