author | Michael Krelin <hacker@klever.net> | 2018-07-25 05:59:03 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2018-07-25 05:59:03 (UTC) |
commit | 0d6c302f5e23490aec29d6e8cc2dffc0adce8602 (patch) (unidiff) | |
tree | 3337b5a77e38f0e49cb30d1fa1f9357d1699ad97 /pushfittery.scad | |
parent | 3f077364320ef368c4fd64d476c6e9fd9394c07a (diff) | |
download | extrudery-0d6c302f5e23490aec29d6e8cc2dffc0adce8602.zip extrudery-0d6c302f5e23490aec29d6e8cc2dffc0adce8602.tar.gz extrudery-0d6c302f5e23490aec29d6e8cc2dffc0adce8602.tar.bz2 |
draft of the more materials mixer
-rw-r--r-- | pushfittery.scad | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/pushfittery.scad b/pushfittery.scad new file mode 100644 index 0000000..adebec2 --- a/dev/null +++ b/pushfittery.scad | |||
@@ -0,0 +1,43 @@ | |||
1 | draft = true; | ||
2 | |||
3 | use <threads.scad>; | ||
4 | |||
5 | function pf_(d,k) = d[search([k],d)[0]][1]; | ||
6 | function pf_d(pf) = pf_(pf,"d"); | ||
7 | function pf_h(pf) = pf_(pf,"h"); | ||
8 | module pushfit(pf,draft=draft) { | ||
9 | fnd = 2*PI; epsilon=.01; | ||
10 | type = pf_(pf,"type"); | ||
11 | h = pf_h(pf); | ||
12 | if(type=="threaded") { | ||
13 | minch = 25.4; | ||
14 | d = (pf_d(pf) + pf_(pf,"d_tolerance"))/minch; | ||
15 | tpi = pf_(pf,"tpi"); | ||
16 | if(draft) cylinder(d=d*minch,h=h+epsilon); | ||
17 | else english_thread(diameter=d,threads_per_inch=tpi,length=h/minch+epsilon,internal=true); | ||
18 | slitl = d*minch+layer_height; | ||
19 | slitw = 0.8*d*minch/2; | ||
20 | echo(slitw,slitl); | ||
21 | translate([-slitw/2,-slitl/2,0]) cube([slitw,slitl,h+epsilon]); | ||
22 | }else if(type=="embedded") { | ||
23 | d = pf_d(pf); | ||
24 | h_ring = pf_(pf,"h_ring"); | ||
25 | d_insert = pf_(pf,"d_insert"); | ||
26 | $fn = d*fnd; | ||
27 | translate([0,0,h-h_ring]) cylinder(d=d,h=h_ring+epsilon); | ||
28 | cylinder(d=d_insert,h=h); | ||
29 | }else if(type=="embeddest") { | ||
30 | d = pf_d(pf); | ||
31 | id = pf_(pf,"id"); | ||
32 | h_legspace = pf_(pf,"h_legspace"); | ||
33 | ch = pf_(pf,"ch"); | ||
34 | $fn = d*fnd; | ||
35 | cylinder(d=id,h=h+1); | ||
36 | cylinder(d=d,h=h_legspace); | ||
37 | dd = (d-id)/2; | ||
38 | translate([0,0,h_legspace-epsilon]) | ||
39 | cylinder(d1=d,d2=id-2*epsilon,h=dd+epsilon); | ||
40 | translate([0,0,h-ch-epsilon]) | ||
41 | cylinder(d1=id-2*epsilon,d2=id+2*ch+2,h=ch+epsilon+1); | ||
42 | } | ||
43 | }//pushfit module | ||