c++ - CGAL Alpha_shape_2 extract boundary vertices -


appreciate if assist me alpha_shape_2. i`m new cgal.

i`m trying extract boundaries 2d data.

alpha_shape_2 alpha(lp.begin(), lp.end(), ft(1000), alpha_shape_2::general); 

alpha_shape_2 call works perfectly. but, i`m confused on how extract boundary vertices.

much appreciate example.

here how points, not sorted:

std::vector<point> result;  for(alpha_shape_2::alpha_shape_vertices_iterator =  alpha_shape.alpha_shape_vertices_begin();     != alpha_shape.alpha_shape_vertices_end();     ++it){      alpha_shape_2::vertex_handle handle = *it;     point p = handle->point();     result.push_back(p); } 

you need start read manual on official website understand concepts. simple examples in cgal not have explanation , functionality. need more familiar actual structure of cgal.

this how segments edges. segments not sorted too, need yourself.

for(alpha_shape_2::alpha_shape_edges_iterator =  alpha_shape.alpha_shape_edges_begin();     != alpha_shape.alpha_shape_edges_end();         ++it){      cgal::kernel::segment segment = alpha_shape.segment(*it);      point p1 = segment.vertex(0);     point p2 = segment.vertex(1);     // here p1 , p2 of segment, part of shape.      .....  } 

you this: enter image description here

that after sort function (sorry can't share. it's not complicated write): cgal alpha shape 2d

update found this source, maybe helpful.


Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -