Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Triangulated Surface Mesh Shortest Paths

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Triangulated Surface Mesh Shortest Paths


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Triangulated Surface Mesh Shortest Paths
  • Date: Mon, 19 Jun 2017 10:11:58 +0200
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:NuYemhcxrlZEw6DTQJOinZVNlGMj4u6mDksu8pMizoh2WeGdxcW7Yh7h7PlgxGXEQZ/co6odzbGH7Oa4ASQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9GiTe5Y75+Ngm6oRnMvcQKnIVuLbo8xAHUqXVSYeRWwm1oJVOXnxni48q74YBu/SdNtf8/7sBMSar1cbg2QrxeFzQmLns65Nb3uhnZTAuA/WUTX2MLmRdVGQfF7RX6XpDssivms+d2xSeXMdHqQb0yRD+v6bpgRh31hycdLzM37X/ZisJwgqJcoxyvqRJwzIHWb46JO/RzZb/dcNEASGZdQspcWS5MD4WhZIUPFeoBOuNYopHzq1UTsxSxHhOjBPjzyj9JmHD227Ax3eImEQHc3QwgGM4Ou2nQoNv0KqgSVuW1w7fUzTXZb/JY2S3y55TUchAmu/GNXbd8fcTMwkQoDAPFilKQqZbkPzOSyuQBqW2b7+57WOKgjm4osQBxojy1ysgwjYnJg5sYx1bZ/it3x4Y1IMe3SE99YdO8FptfrTqVOJByQsw8WW1npCE6yrgetZ66eigK0pUnyATFZ/yJaYiF5A/oWuWJITpghn9od6iziwus/UWg0OHxVde43ExFoydKitXBtHMA2wbN5sWIS/Zx5Fqt1DKB2gzJ6OxJIUY5nrfBJZE72L4/jJ8TvFzDHiDonEX2i7ebdkA+9eip7+Tre7vnppqAO4NthAHzPasjltawAeQ/NQgOUGyb9vqm2LL/+k35Ra1GjvwwkqbHrJDXPcYWq6GjDwNIzIou6wyzAjS43NgCknQKI0pJeBedgIjoP1HOLur4DfC6g1m0izdrw/fGPqfgApXKMnjPirLhfbJm5k5TzQo819Ff55ZOBr4dJ/LzX1f9tMbEAR8hLwy03+HnBc1h2YMRQ22PBraVP77TsV+T+u0vPvKMZJQOtTbmK/kl4ubugmUjlV8ce6mpx5oXZ2qiEvRoOUXKKUfqmcoLRGcWohIlHqutk0yHSTcVZnCoXqt66Ct8E5OjFY6ER4ajh/uK0y6/W5FXfWtbEUvfLXC9fIqNX7IAaTmZP9R6uj0CT7moDYE7hj+0swqvgYFqJOPP5iwVs9rH08J04PGb1T4/8jl5E96M/WiGU2ZujyJCD2st2KdloEthjFKH+ad9iv1cU9dU4qUaAU8BKZfAwrkiWJjJUQXbc4LRRQ==
  • Organization: GeometryFactory

With the current implementation, there is no way to do it better than
inserting each polygon vertex independently, compute the tree, and do the query. It is clearly not the optimal solution as the algortihm is
meant to be used for this purpose.

One thing that might speed things up is to only consider a sub-part of
the mesh that should be containing the edge and only compute the tree
on this sub-part. The tricky part being to get the correct sub-part.

Sebastien.

On 06/16/2017 05:16 PM, TONG FU wrote:
Yes. exactly!

2017-06-16 17:14 GMT+02:00 Sebastien Loriot (GeometryFactory)
<

<mailto:>>:

Let me rephrase to see if I got your question right:
You have an ordered sequence of points on a triangle mesh
(defining a polyline) and you would like to get the polyline
"segments" on the surface mesh between each consecutive pair of points.

Am I right?

Sebastien.


On 06/16/2017 04:54 PM, TONG FU wrote:

Sorry for my language.
I have some polylines on a triangulate surface. I want to
find the
shortest path between each two point of these polylines. So I
use the
package 'triangulated surface mesh shortest path'. I set all
points on
a polyline as a set of source points S. I have a target point
t. If I
want to find the shortest path between t and S(3), what should I do?



2017-06-16 16:32 GMT+02:00 Sebastien Loriot (GeometryFactory)

<

<mailto:>

<mailto:

<mailto:>>>:


Could you rephrase your question, because it is not clear to
me what you
want to know.

Thanks,

Sebastien.

On 06/16/2017 04:11 PM, Tong wrote:

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&lt;&lt;&quot;add source points for one
polyline
finished&quot;&lt;&lt;std::endl;
shortest_paths.source_points_begin();

//calculate the shortest path bewteen two points
for(j = 0;j&lt;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&lt;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

<http://cgal-discuss.949826.n4.nabble.com/Triangulated-Surface-Mesh-Shortest-Paths-tp4662769.html>


<http://cgal-discuss.949826.n4.nabble.com/Triangulated-Surface-Mesh-Shortest-Paths-tp4662769.html

<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.



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





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







Archive powered by MHonArc 2.6.18.

Top of Page