author | Michael Krelin <hacker@klever.net> | 2018-07-31 19:38:01 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2018-07-31 19:38:01 (UTC) |
commit | 2489b5446f56dbabbca9b4ea9f40870c7f4f69e6 (patch) (side-by-side diff) | |
tree | b1e539c512f20c352c99203541b13b8776c7f873 | |
parent | 04f03386761d24bf28759d2dbefa7c9bd10a3726 (diff) | |
download | extrudery-2489b5446f56dbabbca9b4ea9f40870c7f4f69e6.zip extrudery-2489b5446f56dbabbca9b4ea9f40870c7f4f69e6.tar.gz extrudery-2489b5446f56dbabbca9b4ea9f40870c7f4f69e6.tar.bz2 |
pushfittery: don't be too epsilony
-rw-r--r-- | pushfittery.scad | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pushfittery.scad b/pushfittery.scad index fedf2de..c198828 100644 --- a/pushfittery.scad +++ b/pushfittery.scad @@ -1,44 +1,44 @@ layer_height=.2; epsilon=.01; draft = true; use <threads.scad>; function pf_(d,k) = d[search([k],d)[0]][1]; function pf_d(pf) = pf_(pf,"d"); function pf_h(pf) = pf_(pf,"h"); module pushfit(pf,draft=draft) { - fnd = 2*PI; epsilon=.01; + fnd = 2*PI; type = pf_(pf,"type"); h = pf_h(pf); if(type=="threaded") { minch = 25.4; d = (pf_d(pf) + pf_(pf,"d_tolerance"))/minch; tpi = pf_(pf,"tpi"); - if(draft) cylinder(d=d*minch,h=h+epsilon); - else english_thread(diameter=d,threads_per_inch=tpi,length=(h+epsilon)/minch,internal=true); + if(draft) cylinder(d=d*minch,h=h+1); + else english_thread(diameter=d,threads_per_inch=tpi,length=(h+1)/minch,internal=true); slitl = d*minch+layer_height; slitw = 0.8*d*minch/2; echo(slitw,slitl); - translate([-slitw/2,-slitl/2,0]) cube([slitw,slitl,h+epsilon]); + translate([-slitw/2,-slitl/2,0]) cube([slitw,slitl,h+1]); }else if(type=="embedded") { d = pf_d(pf); h_ring = pf_(pf,"h_ring"); d_insert = pf_(pf,"d_insert"); $fn = d*fnd; - translate([0,0,h-h_ring]) cylinder(d=d,h=h_ring+epsilon); + translate([0,0,h-h_ring]) cylinder(d=d,h=h_ring+1); cylinder(d=d_insert,h=h); }else if(type=="embeddest") { d = pf_d(pf); id = pf_(pf,"id"); h_legspace = pf_(pf,"h_legspace"); ch = pf_(pf,"ch"); $fn = d*fnd; cylinder(d=id,h=h+1); cylinder(d=d,h=h_legspace); dd = (d-id)/2; translate([0,0,h_legspace-epsilon]) cylinder(d1=d,d2=id-2*epsilon,h=dd+epsilon); translate([0,0,h-ch-epsilon]) cylinder(d1=id-2*epsilon,d2=id+2*ch+2,h=ch+epsilon+1); } }//pushfit module |