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