How can I get X, Y (and Z) coordinates of a shape (/Body) in Matlab?

조회 수: 5 (최근 30일)
Cam S
Cam S 2019년 7월 19일
댓글: Cam S 2019년 7월 21일
Hi I have a rectangle with rounded corners which I got through this:
figure
rectangle('position',[0 -1 10 2],'Curvature',[1])
axis equal
grid minor
But I need to get a list of x,y coordinates starting at the middle of the bottom line. it would also be useful to vary the number of coordinates I can get.
I'm trying to get draw a plate (basically a rectangle with rounded corners). If I don't use the function I did before how could I do it? essentially the x-coordinates would be the length of the plate, and the y-coordinates would be the height. I'm trying to get a number of x,y coordinates (which I can vary, say 200 coordinates to start with) starting at the middle bottom of the plate and then going anti-clockwise around the plate.
So to recap, starting at the middle bottom of the plate i need to get around 200 x,y coordinates anti-clockwise back to the middle bottom of the plate, but these coordinates have to follow a specific geometry (for now the shape of the plate, I think later I might change the shape.
[So i need a continuous path of points, equal distance from each other, following the perimeter of a shape/drawing/line/etc.]
I'm finding it really hard to explain, I hope this helps at least a little.
Regards,
  댓글 수: 14
Adam Danz
Adam Danz 2019년 7월 21일
Yeah, it can be confusing for newbies. I find it helpful to followi the examples that are included in all matlab functions in the documentation. For example, here's the example section for interp1
Cam S
Cam S 2019년 7월 21일
Cool. Thanks.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Array and Matrix Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by