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

14 views (last 30 days)
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 Comments
Adam Danz
Adam Danz on 21 Jul 2019
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

Sign in to comment.

Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!