Alpha_shape_2 edges vs vertices

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Alpha_shape_2 edges vs vertices

Acecross
If I extract classified point sets from my alpha shape I get different
results depending on which of the following code blocks I use:
template <class OutputIterator>
void alpha_edges(const Alpha_shape_2& A, OutputIterator out,
Alpha_shape_2::Classification_type c)
{
  Alpha_shape_vertices_iterator it = A.alpha_shape_vertices_begin(),
                             end = A.alpha_shape_vertices_end();
  for( ; it!=end; ++it){
    if (A.classify(*it) == c){
        Point_2 p = (*it)->point();
        *out++ = p ;}
        }
}
Or getting the points over segments:

template <class OutputIterator>
void alpha_segments(const Alpha_shape_2& A, OutputIterator out,
Alpha_shape_2::Classification_type c)
{
  //A.set_alpha(FT(130));
  Alpha_shape_edges_iterator it = A.alpha_shape_edges_begin(),
                             end = A.alpha_shape_edges_end();
  for( ; it!=end; ++it){
    if (A.classify(*it) == c){
        Segment_2 p = A.segment(*it);
        Point_2 p1 = p.vertex(0);
        Point_2 p2 = p.vertex(1);
        *out++ = p1 ;
        *out++ = p2 ;
        }
        }
}
Classifiers Regular and Singular were used.



--
Sent from: http://cgal-discuss.949826.n4.nabble.com/

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss