restart;
with(plots);
with(plottools);
zombie := [cuboid([-0.22, 1.78, -0.15], [-0.04, 2.14, 0.13], color = "#4F4F6A"), cuboid([0.04, 1.78, -0.15], [0.22, 2.14, 0.13], color = "#4F4F6A"), cuboid([-0.27, 2.14, -0.21], [0.27, 2.72, 0.21], color = "#6B7FBF"), cuboid([-0.55, 2.30, -0.58], [-0.27, 2.65, -0.19], color = "#7EAA6E"), cuboid([0.27, 2.30, -0.58], [0.55, 2.65, -0.19], color = "#7EAA6E"), cuboid([-0.36, 2.72, -0.36], [0.36, 3.44, 0.36], color = "#7EAA6E"), cuboid([-0.36, 3.20, -0.36], [0.36, 3.44, 0.36], color = "#1C140A"), cuboid([-0.36, 2.72, 0.20], [0.36, 3.44, 0.36], color = "#1C140A"), cuboid([-0.36, 2.90, -0.36], [-0.30, 3.44, 0.20], color = "#1C140A"), cuboid([-0.31, 3.02, -0.37], [-0.10, 3.22, -0.34], color = "White"), cuboid([0.10, 3.02, -0.37], [0.31, 3.22, -0.34], color = "White"), cuboid([-0.28, 3.04, -0.38], [-0.13, 3.19, -0.35], color = "#CC2222"), cuboid([0.13, 3.04, -0.38], [0.28, 3.19, -0.35], color = "#CC2222"), cuboid([-0.07, 2.93, -0.37], [0.07, 3.02, -0.34], color = "#7EAA6E"), cuboid([-0.20, 2.82, -0.37], [0.20, 2.91, -0.34], color = "#2E1810"), cuboid([-0.16, 2.84, -0.38], [-0.07, 2.90, -0.35], color = "White"), cuboid([0.07, 2.84, -0.38], [0.16, 2.90, -0.35], color = "White")];
chicken := [cuboid([-0.5, 0, -0.3], [-0.2, 0.8, 0.3], color = "Yellow"), cuboid([0.2, 0, -0.3], [0.5, 0.8, 0.3], color = "Yellow"), cuboid([-0.8, 0.8, -0.6], [0.8, 1.8, 0.6], color = "White"), cuboid([-1.1, 1.0, -0.4], [-0.8, 1.6, 0.4], color = "White"), cuboid([0.8, 1.0, -0.4], [1.1, 1.6, 0.4], color = "White"), cuboid([-0.3, 1.2, 0.6], [0.3, 1.6, 0.9], color = "White"), cuboid([-0.5, 1.8, -1.1], [0.5, 2.6, -0.1], color = "White"), cuboid([-0.15, 2.1, -1.4], [0.15, 2.4, -1.1], color = "Yellow"), cuboid([-0.4, 2.2, -1.1], [-0.2, 2.4, -1.05], color = "Black"), cuboid([0.2, 2.2, -1.1], [0.4, 2.4, -1.05], color = "Black"), cuboid([-0.15, 2.6, -0.9], [0.15, 2.9, -0.3], color = "Red"), cuboid([-0.6, 1.8, -0.3], [0.6, 1.95, 0.3], color = "Brown")];
L := 6;
H := 1.3;
rope_h := [0.45, 0.85, 1.25];
r_post := 0.07;
r_rope := 0.03;
mat_thick := 0.25;
mat := plottools:-cuboid([-L/2, -L/2, -mat_thick], [L/2, L/2, 0], color = "Gray");
corners := [[-L/2, -L/2], [L/2, -L/2], [L/2, L/2], [-L/2, L/2]];
posts := [seq(plot3d([corners[i][1] + r_post*cos(t), corners[i][2] + r_post*sin(t), z], t = 0 .. 2*Pi, z = 0 .. H, color = "Navy", style = surface, grid = [16, 10]), i = 1 .. 4)];
make_rope := proc(side, h, r) local x1, y1, x2, y2; if side = 1 then x1 := -1/2*L; y1 := -1/2*L; x2 := -1/2*L; y2 := 1/2*L; elif side = 2 then x1 := 1/2*L; y1 := -1/2*L; x2 := 1/2*L; y2 := 1/2*L; elif side = 3 then x1 := -1/2*L; y1 := -1/2*L; x2 := 1/2*L; y2 := -1/2*L; else x1 := -1/2*L; y1 := 1/2*L; x2 := 1/2*L; y2 := 1/2*L; end if; plots:-tubeplot([x1 + (x2 - x1)*s, y1 + (y2 - y1)*s, h], s = 0 .. 1, radius = r, color = "Crimson", tubepoints = 12); end proc;
ropes := [seq(seq(make_rope(side, h, r_rope), side = 1 .. 4), h in rope_h)];
ring := display(mat, op(posts), op(ropes));
display(zombie, chicken, ring);