How can I intersect a line and a 3D object (cube, sphere, prism)?
3 次查看(过去 30 天)
显示 更早的评论
Hello everyone, I am doing a program for the faculty, and in one part of the program I need to know the penetration distance between a line (incident beam) and a geometric shape loaded by the user, which in general can be a cube, sphere or Prism, nothing too complicated. Do you have any idea how I could deal with the problem? The user would initially enter the geometric parameters of the figure, such as radius, height and others. Based on this, he would have to generate the figure and intersect it. I was reading a bit the programs for computational geometry but I get a little dizzy, I am a little new in matlab. If you know any way to solve it or any good reading for the subject I would really appreciate it! Thank you.
0 个评论
回答(1 个)
darova
2019-9-19
It is a pyramid. If you want to know if line intersects pyramid you should inspect each plane of it
Once you have all intersection points - inspect if there are points belonging to walls of pyramid
There are conditions that have to be met (use dot product to calculate angle):
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!