//three main input parameters (w_in, h_in, kerf) of this program w_in = 8; //width of inner notch h_in = 8; //height or length of inner notch kerf= 0.25; //dimension of outer notch is automatically adjusted by taking kerf into account w_out =w_in + kerf; //width of outer notch h_out = h_in + kerf; //length of outer notch //this module creates notches inside the 2D surface body. Parameters "HowMany" indicates the number of such inside notches. module notchesInside (HowMany){ for(i = [0:HowMany]){ rotate(i*360/HowMany) //each notch is rotated equally from the previous notch. For example, if we have 4 notches, each neighbouring notch will be paced at the angle of 360/4 = 90 degrees from each other translate([11,-3.5,0]) //translate operator, and its parameters (X,Y,Z) method ensures that the next body is created (X,Y,Z) mm away from the current body square([h_in, w_in]); } } // module notchesInside2 and module notchesInside3 do the same job as the previous notchesInside module but with the difference that the dimensions of the notches inside are different module notchesInside2 (HowMany){ for(i = [0:HowMany]){ rotate(i*360/HowMany) translate([16,-3.5,0]) square([h_in, w_in]); } } module notchesInside3 (HowMany){ for(i = [0:HowMany]){ rotate(i*360/HowMany) translate([6,-3.5,0]) square([h_in, w_in]); } } //this module creates notches outside the 2D surface body which acts as a hook. Here, kerf needs to be taken into account. Paanaters "h_out, w_out" are adjusted by taking kerf into account automatically. //Parameter "HowMany" indicates the number of such outside notches. module notchesOutside(HowMany){ for(i = [0:HowMany]){ rotate(i*360/HowMany) translate([15,-3.5,0]) square([h_out, w_out]); } } //module faceBox0 and faceBox, both create a surface within which inner notches are made. The difference between these modules is the dimension of the square surface is different. module faceBox0(){ difference(){ //difference operator is used to take out material from the surface. it works like boolean interfaction. Here, a solid region for 4 notches will be taken our from the square surface. square(30, center=true); notchesInside3(4); translate([-4, -4, 0]) square([h_in, w_in]); } } module faceBox(){ difference(){ square(40, center=true); notchesInside(4); translate([-4, -4, 0]) square([h_in, w_in]); } } //it creates a rectangle with two outer notches, and one inner notch. It acts as connector between various supports. module bottomBox (){ difference(){ square([30.3, 20.4], center=true); translate([-15,0,0]) notchesInside(1); } notchesOutside(2); //two outer notches which act as hook to connect two surface } //this module has one outer notch and one inner notch module jointBinary(){ difference(){ square([30, 20], center=true); translate([-26,0,0]) notchesInside(1); //one inner notch } notchesOutside(1); //one oute notch } //these module creates the first floor of the tower. It has four inner notches near the edge. module faceBox2(){ difference(){ square(50, center=true); notchesInside2(4); // your inner notches translate([-4, -4, 0]) square([h_in, w_in]); } } //this module creates the base of the tower floor (figure 9) with total 9 notches. module faceBox3(){ difference(){ square(50, center=true); notchesInside2(4); // first layer 4 inner notche notchesInside3(4); //second layer of 4 notches translate([-4, -4, 0]) square([h_in, w_in]); //one notch as the very center } } //modules described above are now here being called to execute those modules to create various 2D structures //translate operator ensures that all 2D structures do not overlap with each other. faceBox0(); translate([50,0,0]) faceBox0(); translate([100,0,0]) faceBox(); translate([150,0,0]) faceBox(); translate([200,0,0]) bottomBox(); translate([250,0,0]) bottomBox(); translate([300,0,0]) bottomBox(); translate([350,0,0]) bottomBox(); translate([0,-40,0]) bottomBox(); translate([50,-40,0]) bottomBox(); translate([100,-40,0]) bottomBox(); translate([150,-40,0]) bottomBox(); translate([200,-40,0]) bottomBox(); translate([250,-40,0]) bottomBox(); translate([300,-40,0]) jointBinary(); translate([350,-40,0]) jointBinary(); translate([0,-80,0]) jointBinary(); translate([50,-80,0]) faceBox2(); translate([105,-80,0]) faceBox2(); translate([160,-80,0]) faceBox3(); translate([215,-80,0]) faceBox3();