필터 지우기
필터 지우기

How can I intersect a line and a 3D object (cube, sphere, prism)?

조회 수: 3 (최근 30일)
rafael gijon
rafael gijon 2019년 9월 19일
답변: darova 2019년 9월 19일
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.

답변 (1개)

darova
darova 2019년 9월 19일
It is a pyramid. If you want to know if line intersects pyramid you should inspect each plane of it
11Untitled.png
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):
21Untitled.png

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by