chiark / gitweb /
poster-tube-lid: catch: adjust stalk height from v1
[reprap-play.git] / trackpump-mutlihead-clip.scad
1 // -*- C -*-
2
3 include <commitid.scad>
4
5 pump_main_dia = 38;
6 pump_side_width = 5;
7 pump_side_thick = 4;
8 pump_shaft_dia = 14;
9 baseplate = 3;
10
11 pump_protr_flat = 3;
12 pump_protr_slope = 0.9;
13
14 hose_inner_dia = 20;
15 hose_aperture = 11;
16 hose_side_width = 5;
17 hose_base_offset = 30;
18
19 hose_side_thick = 6;
20 hose_side_stalk_width = 6;
21
22 pump_protr_protr = 3;
23 pump_side_height = 20;
24
25 // calculated
26 pump_protr_slheight = pump_protr_protr / pump_protr_slope;
27
28 pump_side_outer_rad = pump_side_width + pump_main_dia/2;
29
30 baseplate_width_rad =
31   sqrt( pow(pump_side_outer_rad, 2)
32         -pow( pump_main_dia/2 - pump_protr_protr, 2) );
33
34 xm = baseplate + pump_main_dia/2;
35
36 pump_side_total_height =
37   pump_side_thick + pump_side_height + pump_protr_slheight + pump_protr_flat;
38
39 $fa=5;
40
41 module PumpSidePlan() {
42   or = pump_side_outer_rad;
43   difference(){
44     union(){
45       intersection(){
46         translate([-xm, 0]) circle(r=or);
47 //      translate([-(xm+or), -or]) square([xm+or, or*2]);
48       }
49     }
50     translate([-xm-or, 0])
51       square(center=true, [pump_side_width*4, pump_shaft_dia]);
52   }
53 }
54
55 module PumpSideElevation(){
56   x3 = 0;
57   x2 = x3 - baseplate;
58   x1 = x2 - pump_main_dia;
59   x0 = x1 - pump_side_width;
60   x2a = x2 - pump_protr_protr;
61   x4 = x2 + pump_side_width;
62
63   z0 = 0;
64   z1 = z0 - pump_side_thick;
65   z2 = z1 - pump_side_height;
66   z2a = z2 - pump_protr_slheight;
67   z2b = z2a - pump_protr_flat;
68
69   arcx = x2-x1;
70   arcy = z1-z2;
71
72   translate([x0,z1]) square([x1-x0, z0-z1]);
73
74   difference(){
75     translate([x1,z2]) square([x3-x1, z0-z2]);
76     translate([x1,z2]) scale([1,arcy/arcx]) circle(r=arcx);
77   }
78
79   translate([x2,z2a]) square([x4-x2, z0-z2a]);
80
81   hull(){
82     translate([x2,z2a]) square([x4-x2, z2-z2a]);
83     translate([x2a,z2b]) square([x3-x2a, z2a-z2b]);
84   }
85 }
86
87 module PumpSide(){
88   br = baseplate_width_rad;
89   brs = hose_side_stalk_width/2;
90   echo(brs);
91
92   difference(){
93     intersection(){
94       translate([0,100,0])
95         rotate([90,0,0])
96         linear_extrude(height=200, convexity=10)
97         PumpSideElevation();
98       union(){
99         translate([0,0,-100])
100           linear_extrude(height=200, convexity=10)
101           PumpSidePlan();
102         // baseplate
103         hull(){
104           mirror([0,0,1])
105             translate([-xm, -brs, 0])
106             cube([pump_main_dia/2 + pump_side_width,
107                   brs*2,
108                   1]);
109           translate([-xm, -br, -pump_side_total_height])
110             cube([xm,
111                   br*2,
112                   pump_protr_flat]);
113         }
114       }
115     }
116     translate([-(baseplate + pump_main_dia/2), 0,
117                 -(pump_side_thick + pump_side_height)])
118       cylinder(r=pump_main_dia/2, h=200);
119   }
120   rotate([0,0,180])
121     mirror([0,0,1])
122     translate([-0,
123                -br,
124                pump_side_total_height])
125     Commitid_BestCount_M([baseplate + pump_protr_protr,
126                           br*2]);
127 }
128
129 module HoseSidePlan(){
130   ro = hose_inner_dia/2 + hose_side_width;
131   ri = (hose_inner_dia/2);
132   st = hose_side_stalk_width/2;
133
134   apx = sqrt( ri*ri - (hose_aperture*hose_aperture)/4 );
135   apsq = hose_base_offset + apx - hose_aperture/2;
136   echo(apx,apsq);
137
138   difference(){
139     union(){
140       translate([-1, -st]) square([hose_base_offset+1, st*2]);
141       translate([hose_base_offset, 0]) circle(r= ro);
142     }
143     translate([hose_base_offset, 0]) circle(r= hose_inner_dia/2);
144     translate([apsq, 0])
145       rotate(-45)
146       square([50,50]);
147   }
148
149   //%translate([hose_base_offset + apx, 0]) square([50,50]);
150   //%square(center=true, [100, hose_aperture]);
151 }
152
153 module HoseSide(){
154   mirror([0,0,1])
155     linear_extrude(height=hose_side_thick, convexity=10)
156     HoseSidePlan();
157 }
158
159 module Clip(){
160   PumpSide();
161   HoseSide();
162 }
163
164 module ClipPrint(){
165   rotate([180,0,0])
166     Clip();
167 }
168
169 //PumpSidePlan();
170 //PumpSideElevation();
171 //PumpSide();
172 //HoseSide();
173 //Clip();
174 ClipPrint();