i created this user input 3d plot to ultimately create a shape that fit in the corner of the dodecagon pyramid. i want to convert this new shape to an stl file to print on a 3d printer.
**** Update *****
The new shape has been made without meshgrid, now has clean edges. how would i go about saving this figure to scale in the same 3d plane as the dodecagon pyramid, but without the pyramid being displayed. also, how would i give this new plane mass or thickness???
sidelength = input('Enter Side length: ');
height = input('Enter Height: ');
V=nsidedpoly(12,'Side',sidelength).Vertices;
V(end+1,3)=-height;
trisurf( delaunay(V(:,1:2)), V(:,1), V(:,2), V(:,3),'FaceColor','c')
%% calculating angle for new shape based off sidelength and height input
x6 = (sidelength*3.078)/2; %side to side to determine base length for angle1
a = ((2+sqrt(3))*(sidelength))/2; %point to point to determine midpoint starting location for new shape
a8 = (3.236*sidelength);
a1 = (a)*0.9;
h1 = -height;
angle1 = atand(height/x6);
angle2 = 90-angle1;
L = sidelength/2;
L1 = -1*(sidelength/2);
L12 = ((L)*0.9);% Y axis scaled 1:10
L123 = ((L1)*0.9)
angle_12 = 150;
d = (-1*height)*0.1; % Z axis scaled 1:10
b1 = (((sqrt(6)+sqrt(2))/2)*(sidelength));
c1 = ((sqrt(3)+1)*sidelength)*0.5;
c11 = (c1)*0.9
c2 = -(1.902*sidelength)*0.5;
hold on
plot(c1,c1,"*")
plot(a,L,"*")
plot(a,L1,"*")
plot3([a a1], [L L12], [0 d],"m");
plot3([a a1], [L1 L123], [0 d]);
plot3([c1 c11], [c1 c11], [0 d]);
x = [c1, c11, a1, a1, a, a];
y = [c1, c11, L12, L123, L1, L];
z = [0, d, d, d, 0, 0];
c = [1, 0, 0, 1, 1, 0]
figure(2)
patch(x,y,z,c)