- Identify the surface of the mesh that contains the two points. You can use a function like point2trimesh to determine which triangle the points belong to.
- Calculate the normal vector to the surface at one of the points. You can use the function surfnormal to obtain the normal vector.
- If the surface is a plane, you can use the equation of the plane to calculate a straight line that passes through the two points. If the surface is curved, you can use the normal vector and the curvature of the surface to calculate a curved path that passes through the two points and lies on the surface.
- Generate points along the calculated path and check that they lie on the surface of the mesh. You can use point2trimesh again to ensure that each point is on the surface.
- Repeat the above steps for other pairs of points to generate additional paths/trajectories.
How to generate a path over a triangular mesh
5 views (last 30 days)
Show older comments
Hi guys,
I'm trying to generate paths/trajectories over a mold mesh. I would like to select two arbitrary points which belong to the same surface of the mesh, and then compute the path, as a straight line if i'm on a plane surface or curved line if i'm on a curved surface. Anyway, I need that each line pass through the selected points, and it lies on the surface(so the mesh).
Does anyone has suggestions?
Thanks in advance.
0 Comments
Answers (1)
Abhijeet
on 4 Apr 2023
To generate paths/trajectories over a mold mesh that pass through two arbitrary points on the same surface of the mesh, you can use the following steps:
Note : The accuracy of the calculated paths will depend on the accuracy of the surface mesh and the chosen method for calculating curved paths.
Hope it answers your query.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!