%% Boundary Outlier
% Remove an outlier boundary point from a polygon, eliminating the extraneous sliver or antenna effect.

polyin = polyshape([0 0 2 2 1.0001 1 0.9999],[2 0 0 2 2 10 2]);
plot(polyin)
xlim([-0.5 2.5])
ylim([-2 12])
polyout = rmslivers(polyin,0.001);
plot(polyout)
xlim([-0.5 2.5])
ylim([-2 12])

% Copyright 2012 The MathWorks, Inc.