Get xyz position of points along a line between 2 points along a 3D triangular mesh

2 次查看(过去 30 天)
I have a 3D triangular mesh. It is defined by vertex positions and triangles.
I would like to be able to select 2 vertices on that surface and connect them with a line along the surface.
What i require as an output is a series of positions (xyz) between the two selected points. Is there a easy way to extract that information from the triangular mesh?
Thank you.
  1 个评论
Roger Stafford
Roger Stafford 2014-7-5
If this is a 3D triangular mesh, there is nothing unique about a "line" along the triangular surface connecting two given vertices. How do you define your "line"? It is to be the geodesic (shortest path)? If so, you are asking a difficult question.

请先登录,再进行评论。

采纳的回答

John D'Errico
John D'Errico 2014-7-5
You need to be more specific. Think about your goal, and carefully define what you mean.
For example, the path you describe might arise in several ways. The shortest path contained in the surface is not a trivial thing to compute. However, if you define the path as that which is obtained from a vertical cutting plane through the two points, then it is easy enough to generate.
1. Determine which triangles have at least one vertex on each side of the cutting plane.
2. For each triangle so cut, determine which edges are crossed, and using linear interpolation, find the point of intersection. There must be EACTLY two points of intersection as long as the triangle is not "degenerate". Here degenerate would be defined by triangles that are fully contained in the cutting plane, or triangles where an edge is contained in the cutting plane. Such degeneracies can be treated of course by careful code.
3. Since each triangle that was cut has defined a line segment, connect those segments to form a path across the surface.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Computational Geometry 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by