chiark / gitweb /
sealing-box, bike-lipo-box: $-ise wallthick
[reprap-play.git] / bike-lipo-box.scad
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 $sealingbox_wallthick = wallthick;
72
73 floorth = 2.5;
74 ceilth = 2.5;
75 innertube = 1.0 + 0.2;
76 lidoverlap = 1.5;
77 lidoverhang = 6;
78 tubesealrad = 2.0;
79
80 ts_xbox = 30;
81 ts_ybox = 25;
82 ts_cnrrad = 10;
83 ts_zbox = 8;
84
85 include <sealing-box.scad>
86
87 module TestSealBox(){ ////toplevel
88   TestSealBoxBox();
89   translate(ts_cidoff)
90     Commitid_BestCount([ts_xbox,ts_ybox] - 2*ts_cidoff);
91 }
92
93 module TestSealLid(){ ////toplevel
94   difference(){
95     TestSealBoxLid();
96
97     translate([ts_xbox * .75, ts_ybox/2, 0])
98       cylinder(h=100, r=5);
99     
100     translate([-wallthick + ts_cnrrad*.5,
101                ts_cnrrad*.5 - wallthick,
102                ts_zbox + ceilth])
103       Commitid_BestCount([ts_xbox * .75 - 2.5 - (ts_cnrrad*.5),
104                           ts_ybox - (ts_cnrrad*.5 - wallthick)*2]);
105   }
106 }
107
108 module TestSealLidPrint(){ ////toplevel
109   rotate([180,0,0]) TestSealLid();
110 }
111
112 module ProfileDemos(){ ////toplevel
113   SealingBox_WallProfile();
114   color("blue") SealingBox_FloorProfile();
115   SealingBox_LidProfile();
116   color("blue") SealingBox_CeilProfile();
117   color("red") translate([-5,0]) square([1,ts_zbox]);
118 }
119                           
120 //TestWall();
121 //ProfileDemos();
122 //TestSealBox();
123 //TestSealLid();
124 //FArcSegment_mask(350);