how i find intersection point between 3d stl object and a line
Show older comments
i have a face uploaded as an stl file which is made up of faces and matrices i have a line passing through the surface i want to find the point where the line and surface intersects

4 Comments
jabrie
on 22 Jul 2018
Did you find an efficient approach to solve this problem? I am also working with stl files (triangle meshes). But testing millions of 3D triangles for intersection with a line would not be efficient enough.
Muhamad Amirulfaris Abdullah
on 7 Nov 2018
may i know how you create the stl file?
Since R2018b, MATLAB has built-in STL tools. You don't need to download anything.
For legacy versions needing third-party tools, I'd strongly recommend these tools over other FEX tools. This explains why.
If you use #22409 or #29906 in a modern installation, you will shadow the inbuilt tools and likely cause problems for yourself unless you rename them. FEX #30923 has significant bugs. #51200 is good, but is superceded completely by #182013.
Answers (1)
deru jian
on 3 May 2018
1 vote
STL approximate the outer surface of the 3D model by a number of connected triangles, so you could take a look at the ray/triangle intersection algorithms, that may help you.
Following are some ray/triangle Intersection functions:
Categories
Find more on STL (STereoLithography) in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!