chiark / gitweb /
sealing-box, bike-lipo-box: $-ise many more vars (nfc)
[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_wallthick = 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 ts_cnrrad = 10;
87
88 include <sealing-box.scad>
89
90 module TestSealBox(){ ////toplevel
91   TestSealBoxBox();
92   translate(ts_cidoff)
93     Commitid_BestCount([totx_outer,toty_outer] - 2*ts_cidoff);
94 }
95
96 module TestSealLid(){ ////toplevel
97   difference(){
98     TestSealBoxLid();
99
100     translate([totx_outer * .75, toty_outer/2, 0])
101       cylinder(h=100, r=5);
102     
103     translate([-wallthick + ts_cnrrad*.5,
104                ts_cnrrad*.5 - wallthick,
105                totz_inner + $sealingbox_ceilth])
106       Commitid_BestCount([totx_outer * .75 - 2.5 - (ts_cnrrad*.5),
107                           toty_outer - (ts_cnrrad*.5 - wallthick)*2]);
108   }
109 }
110
111 module TestSealLidPrint(){ ////toplevel
112   rotate([180,0,0]) TestSealLid();
113 }
114
115 module ProfileDemos(){ ////toplevel
116   SealingBox_WallProfile();
117   color("blue") SealingBox_FloorProfile();
118   SealingBox_LidProfile();
119   color("blue") SealingBox_CeilProfile();
120   color("red") translate([-5,0]) square([1,totz_inner]);
121 }
122                           
123 //TestWall();
124 //ProfileDemos();
125 //TestSealBox();
126 //TestSealLid();
127 //FArcSegment_mask(350);