필터 지우기
필터 지우기

Intersection of 3D ray and surface of revolution

조회 수: 11 (최근 30일)
Frank
Frank 2013년 4월 25일
Greetings. I'm looking for an efficient routine to find the 3D intersection point of a ray and a surface of revolution. Assume we have the generic 3D vase of height H, generated by revolving a curve of pre-stored data points. Sit the vase on the x-y plane with the center of the base over the origin. Now shoot a 3D ray from the origin in an az-el direction to an altitude of H, long enough to travel through the vase surface. The shape of the vase is such that the ray will only hit one point on the surface, probably between the predefined data points. Can the community weigh in on the most efficient way to find the intersection point? I have several brute-force solutions that look downright ugly but seem to produce reasonable results. Thanks.
  댓글 수: 4
Matt J
Matt J 2013년 4월 25일
What is "CCW"?
Frank
Frank 2013년 4월 25일
편집: Frank 2013년 4월 25일
Sorry. CCW is counter-clockwise, moving from the x-axis toward the y-axis.

댓글을 달려면 로그인하십시오.

채택된 답변

Matt J
Matt J 2013년 4월 25일
편집: Matt J 2013년 4월 25일
I'll assume, without loss of generality, that the CCW angle is zero which means we don't have to work with the 3D surface, only its pre-revolution 1D profile. Since the geometry is circularly symmetric, you can just rotate the solution by the actual, nonzero CCW angle at the end. Let the revolution profile be defined by (r,z) coordinates where vector R are the distance from the origin of your samples and vector Z are their z-coordinates. Let d be the length of your line projected onto the XY plane. Then, the solution Rmin,Zmin could be obtained by,
pp=interp1(Z,R,'linear','pp');
[~,idx]=min(abs(R-Z*d/H));
Zmin = Z(idx);
Zmin = fminsearch(@(z) abs( ppval(pp,z) - z*d/H ), Zmin);
Rmin=ppval(pp,Zmin);
  댓글 수: 2
Frank
Frank 2013년 4월 25일
Agreed. Great answer for the case of circular symmetry, like my simplistic example. In reality though the data points do vary with the rotation (aspect) angle, based on another set of data. This gives an irregular 3D shape for the surface. My initial approach was to use an irregular meshgrid.
Matt J
Matt J 2013년 4월 25일
편집: Matt J 2013년 4월 25일
That's the drawback of restricting the scope of your question to simplistic examples, unfortunately. I suggest you Accept-click my answer, since it does address your posted question. Then pose your true question in a separate thread.
I need to interpolate between the pre-defined data points with whichever method gives accurate enough results.
When you re-post, you should expand on this. How will you decide which method "gives accurate enough results"?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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