How to Discretize a Polygon boundary in to equally spaced points?
Show older comments
The following code plots a polygon (Rectangle with curved corners).
%%
clc
clear all
close all
%%
h=polybuffer( polyshape([0.15 0 -0.15 -0.15 -0.15 0 0.15 0.15], [0.25 0.25 0.25 0.10 -0.05 -0.05 -0.05 0.10]),0.1);
pgon1 = polyshape({h.Vertices(:,1)}, {h.Vertices(:,2)});
xb = (pgon1.Vertices(:,1))';
yb = (pgon1.Vertices(:,2))';
xb = xb(:);
yb = yb(:);
figure
plot(xb, yb, 'DisplayName','All Data')
axis([-0.4 0.4 -0.2 0.4])
Currently, I have a set of points near the curved region and very limited over the straight portions. I want to generate a set of boundary points for this polyshape that are equally spaced. How do I do that?
Accepted Answer
More Answers (1)
Walter Roberson
on 21 Dec 2024
Edited: Walter Roberson
on 21 Dec 2024
1 vote
See John D'errico file exchange contribution interparc https://www.mathworks.com/matlabcentral/fileexchange/34874-interparc
Categories
Find more on Creating and Concatenating Matrices 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!
