I have generated a surface on a 3d plot and have created a 2d curve (closed loop) somewhere on the surface. How to identify the x-, y-coordinates (z-coordinates for all points lying on and inside the curve are same) lying inside the curve? This is somewhat similar to the 'Fill Color' command in MS Paint.
Edit: The curve is a plot of various discrete points.

댓글 수: 1

Amit
Amit 2014년 1월 13일
Do you know the 2d curve? Is it a function or equation?

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

답변 (2개)

Image Analyst
Image Analyst 2014년 1월 13일

0 개 추천

Pass the planar coordinates into polyarea().

댓글 수: 2

Roger Stafford
Roger Stafford 2014년 1월 13일
If the surface bounded by the closed curve is not planar, then "polyarea" will not be very accurate. It would be necessary to do a closely-spaced triangulation of this enclosed surface area and sum the area of the triangles as an approximation.
Image Analyst
Image Analyst 2014년 1월 13일
Right - I thought of that. I wasn't sure how Amit was going to ensure that the curve on the 3D surface lies in a plane (constant z value) but I assume he has some way. Probably not a good assumption.

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

Roger Stafford
Roger Stafford 2014년 1월 13일

0 개 추천

Sahil, if your surface is determined by some equation f(x,y,z) = 0, and if the boundary curve on this surface is determined by another function g(x,y,z) = c for some constant c, then it is likely that points on the surface which are inside the curve satisfy either g(x,y,z) < c or else g(x,y,z) > c. If so, this should furnish you the information you need for a closely-spaced set of points throughout the surface inside the curve to allow you to generate a triangulation of them so as to compute a good approximation for the surface area enclosed.

댓글 수: 2

Sahil
Sahil 2014년 1월 13일
Sorry, I forgot to mention in my description that the boundary curve is a plot of various discrete points. What should be the approach in this case?
Image Analyst
Image Analyst 2014년 1월 13일
Are you saying that you can't use polyarea() for that case for some reason?

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

카테고리

태그

질문:

2014년 1월 13일

댓글:

2014년 1월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by