Subject: CGAL users discussion list
List archive
- From: "Sebastian Marino" <>
- To:
- Subject: Need help with: Holes in 2D Conforming Triangulations and Meshes
- Date: Tue, 18 Mar 2008 18:05:10 -0400
I'm trying to reproduce Figure 34.6 from the following section of the documentation: http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/Mesh_2/Chapter_main.html
I create a 'Constrained_Delaunay_triangulation_2' and, as far as I can tell, add constraints for the interior and exterior boundary correctly and specify a seed. For rendering using OpenGL I use the following code to determine a set of vertices and triangle indices that define the solid portion of the resulting mesh:
std::map<Vertex_handle, unsigned int> vh_to_index_map;
unsigned int index( 0 ); for( CDT::Finite_vertices_iterator iter( cdt.finite_vertices_begin() ); iter != cdt.finite_vertices_end(); iter++ )
{
const Vertex_handle vh( static_cast<Vertex_handle>( iter ) );
Vertex v( *vh );
const Point p( v.point() );
const double x( p.x() );
const double y( p.y() );
_vertices.push_back( Imath::V2d( x, y ) );
vh_to_index_map[vh] = index++;
}
for( CDT::Finite_faces_iterator iter( cdt.faces_begin() ); iter != cdt.faces_end(); iter++ )
{
const Face_handle fh( static_cast<Face_handle>( iter ) );
const Face f( *fh );
const Vertex_handle vh0( f.vertex( 0 ) );
const Vertex_handle vh1( f.vertex( 1 ) );
const Vertex_handle vh2( f.vertex( 2 ) );
_face_indices.push_back( vh_to_index_map[vh0] );
_face_indices.push_back( vh_to_index_map[vh1] );
_face_indices.push_back( vh_to_index_map[vh2] );
}
When visualizing the resulting geometry the mesh is bound correctly on the exterior, the interior boundary edges are present in the mesh, but, faces are present in the region where I expect there to be a hole. I see something that looks like Figure 34.5?
Are there faces in the region that is the hole? If so, how do I identify them so that I can cull them from my rendering?
Thanks for everyone's time and assistance!
-Sebastian.
- Need help with: Holes in 2D Conforming Triangulations and Meshes, Sebastian Marino, 03/18/2008
Archive powered by MHonArc 2.6.16.