]> git.sven.stormbind.net Git - sven/scripts.git/blob - openscad/silva_l1_v3.scad
Add the whole model into one union()
[sven/scripts.git] / openscad / silva_l1_v3.scad
1 union() {
2 //variables
3 thicknes=8.5;
4 material=1.1;
5 leg_length=12;
6
7 //middle part
8 translate([-material/2, 0 ,0])
9     cube([material, 28.5, thicknes]);
10
11     //bottom
12     color("Blue"){
13         translate([-2.1, 0, 0])
14             cube([2.5*material+3, material, thicknes]);
15     } 
16      //top
17     color("Blue"){
18         translate([0, 27.4, 0])
19             cube([2+material/2, material, thicknes]);
20     }
21     
22     
23     //right lower part
24     color("Green"){
25         translate([2+material/2, 0, 0])
26             cube([material, 12, thicknes]);
27     }
28     
29    //right upper part
30     color("Green"){
31         translate([2+material/2, 28.5-leg_length, 0])
32             cube([material, leg_length, thicknes]);
33     }
34     
35
36  /**** left part ****/
37   difference() {
38       // assemble left part
39       union() {
40         // lower left part
41         color("Green"){
42             translate([-2,0,0])
43             rotate(6.2)
44                 cube([material, leg_length, thicknes]);
45        }
46        
47         //middle left part - outside
48        r_outer=3.6/2;
49         color("Blue"){
50             translate([-2.75, 14.25, 0])
51                 cylinder(thicknes, r_outer, r_outer, $fn=50);
52         }
53
54          // middle part
55         color("Blue"){
56             translate([-3.3, 11.75, 0])
57                 cube([material, 5, thicknes]);
58             }
59             
60         // upper left part
61         color("Green"){
62             translate([-3.3,16.7,0])
63             rotate(-6.2)
64                     cube([material, 3, thicknes]);
65        }      
66     }
67  
68     // clear the middle of the left part
69     r_delete=3.4/2;
70       translate([-2.0, 14.25, 0])
71         cylinder(8.5, r_delete, r_delete, $fn=50);
72   }
73   
74   // fill lower left
75   color("Red"){
76       translate([-material*1.8, 0, 0])
77       cube([material*1.8, 10, thicknes]);
78   }
79   }