Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Marking the outer vertices of a triangulation with alpha shape

Subject: CGAL users discussion list

List archive

[cgal-discuss] Marking the outer vertices of a triangulation with alpha shape


Chronological Thread 
  • From: Daniel Duque <>
  • To: cgal-discuss <>
  • Subject: [cgal-discuss] Marking the outer vertices of a triangulation with alpha shape
  • Date: Fri, 24 Jul 2015 11:40:07 -0400

Hello everyone.

I have been using alpha shapes to identify the outer vertices of triangulations
for some time, and I am very happy with the method. However, the underlying triangulation
is destroyed in the process. This often OK, but can be inconvenient if one just wants to "mark"
the nodes as outer, but keeping the triangulation. Right now I am doing this crude treatment
which, as you see, copies the triangulation, destroys it, then marks the vertices on the original
triangulation as outer if the coincide with the nodes of the alpha shape.

The crudest part, as you can see, is that this coincidence is implemented by "locate", since
I have lost any other connection with the original triangulation. I guess I could hack the
copy procedure in order to include a pointer or handle to the original one...

Any ideas will be welcome.

Best,

Daniel Duque
UPM

// T is a global Delaunay triangulation

void surf_detect(void) {

  Triangulation T2(T);

  FT hh= 1.2 * simu.h();

  FT alpha=hh*hh;
  Alpha_shape_2 al( T2, alpha );

  for (Alpha_shape_vertices_iterator asv=al.alpha_shape_vertices_begin();
       asv!=al.alpha_shape_vertices_end();
       ++asv) {

    Point p=(*asv)->point();

//  mark vertices in the alpha shape as boundary vertices
//  implemented by locate (not very efficient, I guess)

    int i;
    Triangulation::Locate_type lt;
    Face_handle fc=T.locate(p, lt , i );
    fc->vertex(i)->boundary.set( true );
  }

  return;
}



Archive powered by MHonArc 2.6.18.

Top of Page