% ALL VALUES IN MM
% Define thickness of entire concrete leg
T=100;

%--Define right side--%
%--Define x-values of left side--%
% State value for x1, half the width of the bottom of the leg
x1=-150;
% State value for x3
x3=-50;
% State value for x5
x5=-150;

% x2 is defined as point 2 directly vertical of point 1
x2=x1;

% x4 is defined as point 4 directly vertical of point 4
x4=x3;

% x6 is defined as point 6 directly vertical of point 5
x6=x5;

%--Define y-values of left side--%
% y1 is 0 since it's on the ground
y1=0;

% Define vertical lengths of each segment of the bar
L1=150;
L2=58;
L3=289;
L4=43;
L5=60;

y2=y1+L1;
y3=y2+L2;
y4=y3+L3;
y5=y4+L4;
y6=y5+L5;

%--Define right side--%
%--Define x-values--%
x7=-x6;
x8=-x5;
x9=-x4;
x10=-x3;
x11=-x2;
x12=-x1;

%--Define y-values--%
y7=y6;
y8=y5;
y9=y4;
y10=y3;
y11=y2;
y12=y1;

%--Generate figure--%
% Vectorize x and y
x=[x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x12];
y=[y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12];

% Fill figure
fill(x,y,[0.5 0.5 0.5])

% Label the points
labels = {'1','2','3','4','5','6','7','8','9','10','11','12'};
tl = text(x(7:12),y(7:12),labels(7:12),'VerticalAlignment','bottom','HorizontalAlignment','left');
tr = text(x(1:6),y(1:6),labels(1:6),'VerticalAlignment','bottom','HorizontalAlignment','right');
for n=1:6
    tl(n).Color='blue';
    tl(n).FontSize = 14;
    tr(n).Color='blue';
    tr(n).FontSize = 14;
end

% Make top block
La=70;
ya=y6+La;
hold on
fill([x6,x6,x7,x7],[y6,ya,ya,y7],[0 0 0])

% Title figure
title('Leg')

% Label axes
xlabel('Width (mm)')
ylabel('Height (mm)')