%% Solid and Hole Boundaries
% Create and plot a triangulation object.

T = [5 1 3; 6 1 4; 5 4 1; 2 6 3; 3 6 5; 2 1 6];
P = [3 0.5; 3.5 1.5; 4 0.5; 3.25 0.6; 3.75 0.6; 3.5 1];
TR = triangulation(T,P);
triplot(TR)
xlim([2.8 4.2])
ylim([0.4 1.8])

% Create and plot a polyshape object whose boundaries are equal to the boundaries of the triangulation. Due to the inner and outer closed boundaries of the triangulation, polyout contains both a hole boundary and a solid boundary.

polyout = boundaryshape(TR)
plot(polyout)

% Copyright 2018 The MathWorks, Inc.