chiark / gitweb /
ec0b43b398b5dc052a688b2b17fe1a40e5a209c1
[reprap-play.git] / bike-lipo-box.scad.m4
1 // -*- C -*-
2
3 include <commitid.scad>
4 include <utils.scad>
5
6 pxp6012_rad = 22.5 / 2 + 0.5; // make circular hole this size in outer wall
7 pxp6012_rad_outer = 32.0 / 2 - 0.5;
8
9 s1930_y = 30.2 + 0.2;
10 s1930_x =   22 + 0.2;
11 s1930_y_outer = 36.4 + 0.2;
12 s1930_x_outer = 27.6 + 0.2;
13
14 s1930_recess = 3;
15 s1930_around = 3;
16 s1930_behind = 3;
17
18 wallthick = 2.5;
19
20 // origin is at centre on outer face wall
21 // outside is towards positive x
22 // mounting is vertical
23 module S1930_Positive(){
24   d = s1930_recess + s1930_behind;
25   translate([-d/2, 0,0])
26     cube([d,
27           s1930_x_outer + s1930_around,
28           s1930_y_outer + s1930_around], center=true);
29 }
30 module S1930_Negative(){
31   cube([60, s1930_x, s1930_y],
32        center=true);
33   translate([1, 0,0])
34     cube([s1930_recess*2+2, s1930_x_outer, s1930_y_outer],
35          center=true);
36 }
37
38 module TestWall(){ ////toplevel
39   sw_ctr = [25, wallthick, 25];
40
41   rotate([0,0,-90]){
42     difference(){
43       union(){
44         cube([50, wallthick, 42]);
45       }
46
47       translate([30, -1, 20])
48         rotate([-90,0,0])
49         cylinder(r = pxp6012_rad, h=10, $fn=60);
50
51       rotate([90,0,0])
52         Commitid_BestCount([15,40]);
53     }
54   }
55
56   difference(){
57     union(){
58       cube([50, wallthick, 50]);
59       translate(sw_ctr)
60         rotate([0,0,90])
61         S1930_Positive();
62     }
63
64     translate(sw_ctr) {
65       rotate([0,0,90])
66         S1930_Negative();
67     }
68   }    
69 }
70
71 floorth = 2.5;
72 ceilth = 2.5;
73 innertube = 1.0 + 0.2;
74 lidoverlap = 1.5;
75 lidoverhang = 6;
76 tubesealrad = 2.0;
77
78 ts_xbox = 30;
79 ts_ybox = 25;
80 ts_cnrrad = 10;
81 ts_zbox = 8;
82
83 include <sealing-box.scad>
84
85 module TestSealBox(){ ////toplevel
86   TestSealBoxBox();
87   translate(ts_cidoff)
88     Commitid_BestCount([ts_xbox,ts_ybox] - 2*ts_cidoff);
89 }
90
91 module TestSealLid(){ ////toplevel
92   difference(){
93     TestSealBoxLid();
94
95     translate([ts_xbox * .75, ts_ybox/2, 0])
96       cylinder(h=100, r=5);
97     
98     translate([-wallthick + ts_cnrrad*.5,
99                ts_cnrrad*.5 - wallthick,
100                ts_zbox + ceilth])
101       Commitid_BestCount([ts_xbox * .75 - 2.5 - (ts_cnrrad*.5),
102                           ts_ybox - (ts_cnrrad*.5 - wallthick)*2]);
103   }
104 }
105
106 module TestSealLidPrint(){ ////toplevel
107   rotate([180,0,0]) TestSealLid();
108 }
109
110 module ProfileDemos(){
111   WallProfile();
112   color("blue") FloorProfile();
113   LidProfile();
114   color("blue") CeilProfile();
115 }
116                           
117 //TestWall();
118 //ProfileDemos();
119 //TestSealBox();
120 //TestSealLid();
121 //FArcSegment_mask(350);