5 // 3D design for a fastener suitable for Reprapss
6 // Copyright 2012,2016 Ian Jackson
8 // This work is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation, either version 3 of the License, or
11 // (at your option) any later version.
13 // This work is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this work. If not, see <http://www.gnu.org/licenses/>.
26 nomrad = height/2 - toothheight;
27 minrad = nomrad - 0.75;
28 maxrad = nomrad + 0.25;
34 toothgap = webthick + webgap*2;
35 basethick = toothheight;
37 module DoveClipPin(h=height) {
38 pinh = h * pinlengthfact;
39 pinheight = nomrad*2 + jawthick*2;
40 translate([0,0, pinheight/2]) intersection(){
43 mirror([0,0,m]) translate([0,0,pinheight/2]) rotate([90,0,0])
44 cylinder($fn=20, r1=minrad, r2=maxrad, h=pinh);
46 translate([-webthick/2, -pinh, -pinheight/2-1])
47 cube([webthick, pinh, pinheight+2]);
49 translate([-maxrad-1, -pinh-1, -pinheight/2])
50 cube([maxrad*2+2, pinh+2, pinheight]);
54 function DoveClip_depth() =
55 basethick + nomrad*2 + toothheight;
57 module DoveClipEnd(baseextend=1, h=7) {
58 cubex = nomrad*2 + jawthick*2;
59 cube0y = -basethick-nomrad*2-toothheight;
60 centrey = -basethick-nomrad;
62 translate([-cubex/2, cube0y, 0])
63 cube([cubex, -cube0y+baseextend, h]);
64 translate([0, centrey, -1])
65 cylinder($fn=20, r=nomrad, h=h+2);
66 translate([-toothgap/2, cube0y-1, -1])
67 cube([toothgap, toothheight+nomrad+1, h+2]);
71 module DoveClipPair(baseextend=1, h=7) {
72 delta = nomrad*2 + jawthick*2 + toothgap;
73 for (x=[-delta/2,delta/2])
75 DoveClipEnd(baseextend=baseextend, h=h);
78 module DoveClipPairBase(baseextend=0.1, h=7, count=2) {
79 delta = nomrad*2 + jawthick;
80 intrude = nomrad + basethick - basepinclear;
82 translate([(i - (count-1)/2) * delta, 0, 0])
83 DoveClipEnd(baseextend=baseextend, h=h);
85 translate([-delta * count/2, -intrude, 0])
86 cube([delta * count, intrude+0.1, h]);
89 module DoveClipPairSane(baseextend=0, h=7, count=2) {
91 translate([0, DoveClip_depth(), 0])
92 DoveClipPairBase(baseextend=baseextend, h=h, count=count);
95 function DoveClipPairSane_width(count=2) =
96 2 * (nomrad + jawthick + ((nomrad*2 + jawthick) * (count-1)/2));
98 module ExtenderPillar(length, height,
99 pillarw=3.5, pillarslope=0.75, webthick=1) {
103 intangle = atan(pillarslope);
104 polyjx = sin(intangle)*pillarr;
105 polyjy = cos(intangle)*pillarr;
106 polyex = -tan(intangle+90)*pillarr;
107 webmidy = height/2+d;
110 translate([0,0,height/2]) mirror([0,0,xmir])
111 translate([0,0,-height/2]) {
113 translate([-1, -pillarr-5, 0.01])
114 cube([length+2, height+pillarr*2+10, height]);
115 mirror([1,0,0]) rotate([0,-90,0])
116 linear_extrude(height=length) union(){
117 circle(r=pillarr, $fn=20);
118 polygon([[polyjx,polyjy-0.1], [polyex, 0],
119 [polyjx,-(polyjy-0.1)]]);
120 polygon([[0,-webthick/2], [0,webthick/2],
121 [webmidy,webthick/2], [webmidy,-webthick/2]]);
127 module ExtenderPillars(length, width, height,
128 pillarw=3.5, pillarslope=0.75, webthick=1,
129 baseweb=false, basewebthick=1) {
130 pilesw = width - pillarw;
132 for (ymir=[0,1]) mirror([0,ymir,0]) translate([0,-pilesw/2,0]) {
133 ExtenderPillar(length, height, pillarw, pillarslope, webthick);
137 translate([0, -pilesw/2, 0])
138 cube([length, pilesw, basewebthick]);
142 module DoveClipExtender(length, ha=7, hb=7, counta=2, countb=2,
143 pillarw=3.5, pillarslope=0.75, webthick=1) {
146 DoveClipPairSane(h=ha, count=counta);
147 translate([length,0,0])
148 DoveClipPairSane(h=hb, count=countb);
149 pillarlen = length - DoveClip_depth() * 2 + 2;
151 pilesw = min(DoveClipPairSane_width(counta), DoveClipPairSane_width(countb))
153 pilesh = min(ha, hb) - 0.5;
155 translate([DoveClip_depth() - 1, 0, 0])
156 ExtenderPillars(pillarlen, pilesw, pilesh,
157 pillarw=pillarw, pillarslope=pillarslope,
161 //DoveClipExtender(length=100, ha=16, hb=20, counta=3, countb=4);