Subject: CGAL users discussion list
List archive
- From: Tong <>
- To:
- Subject: [cgal-discuss] Triangulated Surface Mesh Shortest Paths
- Date: Fri, 16 Jun 2017 07:11:33 -0700 (PDT)
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=SoftFail ; spf=None
- Ironport-phdr: 9a23:bT9sOB1oFb8YJcV7smDT+DRfVm0co7zxezQtwd8Zse0TLfad9pjvdHbS+e9qxAeQG96KtLQc06L/iOPJYSQ4+5GPsXQPItRndiQuroEopTEmG9OPEkbhLfTnPGQQFcVGU0J5rTngaRAGUMnxaEfPrXKs8DUcBgvwNRZvJuTyB4Xek9m72/q89pDXYQhEniaxba9vJxiqsAvdsdUbj5F/Iagr0BvJpXVIe+VSxWx2IF+Yggjx6MSt8pN96ipco/0u+dJOXqX8ZKQ4UKdXDC86PGAv5c3krgfMQA2S7XYBSGoWkx5IAw/Y7BHmW5r6ryX3uvZh1CScIMb5Sqw5VDqj4qpvURPklTsLPCM9/GzZlsB8kKdXrRS8rBJ93oHUepmYOvR+cK3Dft0UWGVOUdpeWSFaHoOxbZECA/YdMepEsYXwoUYFoxukBQmrAePi0iFGhnjw3a01zu8sFg/G3BE8H9IJtnTUo9H4OakJXOC6yanH1zTDb/dM1Tjh74jIdwksrPeRVrx+dsrRzFMgFwLDjliIr4zqJSia2f8Js2eF9eZvSeWvi2shpgpsoTav3t8hhpTIi44L0FzI6yV0zYgvKdGlRkN2b8SoHZReui2CKod7Q90uT3t2tCs6xLAKo4O3cSYExZg9xxPSafqKeJWS7B35TuaeOzJ4iWpleL2hgxay9lCtyujyV8mzylZKrTBJkt/WuX8WzBPT7taIRuFh8Uem3DaDzwHT6udaLkAojafXNp8szqAqmpYNsUnOEDX6lFj4gaKYbEkp9eal5/ziYrr8p5+cM4F0ihv5MqQrgsG/D/k4MhQJX2id9uSx0LPu8Fb2QLVPlPI2k63ZvIrGKsQco661GxVV3Zo76xajEzem18wVkmUILF1ffBKLlpXmO1DVIP/kEPe/mE+snSxwx/HGO73hGo/CImLCkLfnZ7Z96lRTxBA9zdBFtNpoDeQKL/v3H0Pwr9fFFQQRMgquwu+hBs8u+JkZXDezBamWePfcrEOP4O1+eMGDYYYUvHD2LP1ztK2mtmMwhVJIJPrh5pAQcn3tRaw+Lg==
Hello,
I'm now working on the calculation of shortest path between two points. I
have a sequence of the source points. Is it possible to calculate the
shortest path between my target point and one of the source points (for
example, the third point in this sequence)?
Here is my solution. Since each time I remove a source point, the sequence
tree rebuilds. It takes to much time to get the resultat.
face_iterator fit, fit_end;
boost::tie(fit, fit_end) = faces(polyhedron);
std::vector<face_descriptor> face_vector(fit, fit_end);
const std::size_t nb_source_points = n_vertices;
Traits::Barycentric_coordinate face_location = {{0.25, 0.5, 0.25}};
std::vector<Face_location> faceLocations(nb_source_points,
Face_location(face_descriptor(), face_location));
for (j = 0; j < nb_source_points; ++j)
{
faceLocations[j].first=face_vector[boost::lexical_cast<int>(face_id[j])];
}
std::cout<<"construct a shortest path query object and add a range
of source points..."<<std::endl;
Surface_mesh_shortest_path shortest_paths(polyhedron);
shortest_paths.add_source_points(faceLocations.begin(),
faceLocations.end());
std::cout<<"add source points for one polyline
finished"<<std::endl;
shortest_paths.source_points_begin();
//calculate the shortest path bewteen two points
for(j = 0;j<n_vertices-1;j++){
shortest_paths.remove_source_point(shortest_paths.source_points_begin());
face_iterator face_it = faces(polyhedron).first;
std::advance(face_it,boost::lexical_cast<int>(face_id[j]));
// collect the sequence of simplicies crossed by the shortest
path
Sequence_collector sequence_collector;
shortest_paths.shortest_path_sequence_to_source_points(*face_it,
face_location, sequence_collector);
}
Thank you.
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Triangulated-Surface-Mesh-Shortest-Paths-tp4662769.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Triangulated Surface Mesh Shortest Paths, Tong, 06/16/2017
- Re: [cgal-discuss] Triangulated Surface Mesh Shortest Paths, Sebastien Loriot (GeometryFactory), 06/16/2017
- Re: [cgal-discuss] Triangulated Surface Mesh Shortest Paths, TONG FU, 06/16/2017
- Re: [cgal-discuss] Triangulated Surface Mesh Shortest Paths, TONG FU, 06/16/2017
- Re: [cgal-discuss] Triangulated Surface Mesh Shortest Paths, Sebastien Loriot (GeometryFactory), 06/16/2017
- Re: [cgal-discuss] Triangulated Surface Mesh Shortest Paths, TONG FU, 06/16/2017
- Re: [cgal-discuss] Triangulated Surface Mesh Shortest Paths, Sebastien Loriot (GeometryFactory), 06/19/2017
- Re: [cgal-discuss] Triangulated Surface Mesh Shortest Paths, TONG FU, 06/20/2017
- Re: [cgal-discuss] Triangulated Surface Mesh Shortest Paths, Julia Fischer, 06/21/2017
- Re: [cgal-discuss] Triangulated Surface Mesh Shortest Paths, TONG FU, 06/20/2017
- Re: [cgal-discuss] Triangulated Surface Mesh Shortest Paths, Sebastien Loriot (GeometryFactory), 06/19/2017
- Re: [cgal-discuss] Triangulated Surface Mesh Shortest Paths, TONG FU, 06/16/2017
- Re: [cgal-discuss] Triangulated Surface Mesh Shortest Paths, TONG FU, 06/16/2017
- Re: [cgal-discuss] Triangulated Surface Mesh Shortest Paths, Sebastien Loriot (GeometryFactory), 06/16/2017
Archive powered by MHonArc 2.6.18.