chiark / gitweb /
Makefile: Profile for .m4 files
[reprap-play.git] / bike-lipo-box.scad
1 // -*- C -*-
2
3 include <commitid.scad>
4
5 pxp6012_rad = 22.5 / 2 + 0.5;
6 pxp6012_rad_outer = 32.0 / 2 - 0.5;
7
8 s1930_y = 30.2 + 0.2;
9 s1930_x =   22 + 0.2;
10 s1930_y_outer = 36.4 + 0.2;
11 s1930_x_outer = 27.6 + 0.2;
12
13 s1930_recess = 3;
14 s1930_around = 3;
15
16 wallthick = 3.0;
17
18 module TestWall(){
19   sw_ctr = [25, 0, 25];
20
21   rotate([0,0,-90]){
22     difference(){
23       union(){
24         cube([50, wallthick, 42]);
25       }
26
27       translate([30, -1, 20])
28         rotate([-90,0,0])
29         cylinder(r = pxp6012_rad, h=10, $fn=60);
30
31       rotate([90,0,0])
32         Commitid_BestCount([15,40]);
33     }
34   }
35
36   difference(){
37     union(){
38       cube([50, wallthick, 50]);
39       translate(sw_ctr) {
40         rotate([90,0,0])
41           cube([s1930_x_outer + s1930_around,
42                 s1930_y_outer + s1930_around,
43                 s1930_recess*2],
44                center=true);
45       }
46     }
47
48     translate(sw_ctr) {
49       rotate([90,0,0]) {
50         cube([s1930_x, s1930_y, 10], center=true);
51         translate([0,0, -5])
52           cube([s1930_x_outer, s1930_y_outer, 10], center=true);
53       }
54     }
55   }    
56 }
57
58 ts_floorceil = 1.5;
59 ts_outer = [20,20,20];
60 ts_wall = [wallthick,wallthick,ts_floorceil];
61
62 seal_h = 3;
63 seal_w = 1;
64
65 module TestSealSelector(){
66   oz = ts_outer[2];
67   muchxy = [30,30,0];
68   seal_horiz_spare = wallthick - seal_w;
69   seal_horiz_flat_outer = seal_horiz_spare/2;
70   seal_horiz_flat_inner = seal_horiz_spare - seal_horiz_flat_outer;
71 //  translate([0,0, oz/2]){
72     %translate(-muchxy/2) mirror([0,0,1]) cube(ts_outer + muchxy + [0,0,10]);
73     hull(){
74       translate([1,1,0] * seal_horiz_flat_outer)
75         mirror([0,0,1])
76         cube(ts_outer - 2 * [1,1,0] * seal_horiz_flat_outer);
77       translate([1,1,0] * seal_horiz_flat_inner + [0, 0, seal_h])
78         mirror([0,0,1])
79         cube(ts_outer - 2 * [1,1,0] * seal_horiz_flat_inner);
80     }
81 //  }
82 }
83
84 module TestSeal(){
85   difference(){
86     cube(ts_outer);
87     translate(ts_wall) cube(ts_outer - ts_wall*2);
88   }
89 }
90
91 //TestWall();
92 //TestSeal();
93 TestSealSelector();