Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Iterate on the vertices of a skeleton in order

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Iterate on the vertices of a skeleton in order


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Iterate on the vertices of a skeleton in order
  • Date: Fri, 14 Sep 2018 13:52:34 +0200
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:xDcMqBBpxUP2CsTOhsTXUyQJP3N1i/DPJgcQr6AfoPdwSPTzosbcNUDSrc9gkEXOFd2Cra4c1KyO6+jJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6JvjvGo7Vks+7y/2+94fcbglUhjexe69+IAmrpgjNq8cahpdvJLwswRXTuHtIfOpWxWJsJV2Nmhv3+9m98p1+/SlOovwt78FPX7n0cKQ+VrxYES8pM3sp683xtBnMVhWA630BWWgLiBVIAgzF7BbnXpfttybxq+Rw1DWGMcDwULs5Xymp4aV2Rx/ykCoJKiA38G/XhMJzgqxUrh2uqB5jzIDbe4yVKPhzc7nBcd8GS2dMXMBcXDFBDIOmaIsPCvIMMehFoYbjvFQBtwC+BRWtBOzxzD9Dm3n43aog0+QgFgHGwBErE9YPvnvKq9X1MbkdUfyvzKjIzTvMde9Z2Sv66IjSchEtpP+AVq93fMrKzUkvEBnFjlSXqYz5JT+V0+ANvnOU7+plT+2vimonpxttrTiow8chk4/EjZ8bxFDD8CV22oc1JdugRU59e9GrC4BftyWEOIdsXswiRGRotD4mxb0Jo5G7eDIGyJM9xx7Qc/CIaI+I4hX4VOaNOzt4g2hleL25ih2v8kag0vXxWteo3FtOtCZIkdnBumoQ2xDN6cWLUPtw8lm51TuN1A3f8P9ILE81mKbBNpIsxrA9moARvEnDGCL9hV/4g7WMdko+/+il8+Tnbavipp+bL4J0jxvxMqUqmsCmD+U4NxUCU3GV+em8yrHv50L5QLJNjv05lqnWrorWKtgcpq68GwNV04Aj5AijDzq+ztgUgX0KIEhGdR+HlYTlJk/CLfPiAfq/nVigiDJryOrHPr3lDJXNNH/DkLL5cLZm705czxAzzdFY55JIEL0BJfbzV1T+tNzdFBA5Mgi0z/z7B9V604MSQXiPDbOBMKPOrV+I4foiLPWDZIAPvDbxMuUq5//1jXAlhF8dZrKp0IAMaHG4G/RmO1+WbWDtgtcHC2cKvxAxQPbkiF2YAnZvYCO5UKs4oz06E4m7FpzrR4a3gbXH0j3oMIdRYzUMMV2GGGz0doiCE9MLciOVPochvTEDULW9UZ4P3BqysxXrivAvevHQ/TcZso6l0dxd6OjalBV0/jtxWZfOm1qRRn15yztbDwQ927py9BQkmwWzlJNgivkdLuR9ovZAUwM0L5nZlrUoBNX7WwaHddCMGg//HoeWRAopR9d0+OcgJl5nEoz73B/G1iuuRbQSku7TXcFmwufnx3H0Yv1F5TPG2a0m1QR0R8JOMSi5g/c6+VWJQYHOlEqdmuChcqFOhCM=

The skeleton is a graph following the graph concepts from boost. So
you can pick a vertex an navigate in the graph using the free functions
defined in the boost concept.
See http://www.boost.org/doc/libs/release/libs/graph/doc/adjacency_list.html

If you want something more structured, have a look at this example:
https://doc.cgal.org/latest/Surface_mesh_skeletonization/Surface_mesh_skeletonization_2simple_mcfskel_example_8cpp-example.html

We are using the function CGAL::split_graph_into_polylines()
and the struct Display_polylines to get all polylines made of nodes of degree 2 but at their end point. Maybe you can modify Display_polylines
to do what you want to do.

HTH,

Sebastien

On 09/13/2018 06:10 PM, Annie-Pier L. wrote:
Hi,

Is there a way to iterate over vertices of a skeleton in order? I'm trying
with this code but the outputs points are not in order:

typedef CGAL::Mean_curvature_flow_skeletonization<Polyhedron>
Skeletonization;
typedef Skeletonization::Skeleton Skeleton;
typedef Skeleton::vertex_descriptor
Skeleton_vertex;

Skeleton skeleton;
CGAL::extract_mean_curvature_flow_skeleton(*mesh, skeleton);

BOOST_FOREACH(Skeleton_vertex v, vertices(skeleton) )
{
const Point& pts = skeleton[v].point;
skel_pt.push_back(pts);
}

thanks!



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




Archive powered by MHonArc 2.6.18.

Top of Page