%% Write Triangulation to STL Text File
% Create and plot a 2-D triangulation object.

P = [2.5 8.0; 6.5 8.0; 2.5 5.0; 6.5 5.0; 1.0 6.5; 8.0 6.5];
T = [5 3 1; 3 2 1; 3 4 2; 4 6 2];
TR = triangulation(T,P);
triplot(TR)

% Write the triangulation to a text file named tritext.stl.

stlwrite(TR,'tritext.stl','text')

% Copyright 2018 The MathWorks, Inc.