142 tc = ceil(w / (t1 + t2));
144 mr = (type == 2) ? 0 : er;
145 fr = (type == 2) ? er : 0;
146 sg = (type == 2) ? 1 : -1;
151 io = o - sg * tg/4 + (center ? w/2 - (t1*tc + t2*(tc-1))/2 : 0);
163 if (type == 0 || type == 2)
170 for ( i = [0 : tc-1] )
171 translate ([io + (t1 + t2)*i, 0])
192 translate([s1 + te/2, d])
198 pg_rectangle([s1, d], vr=er, vrm=(type == 2) ? [0,0,4,3] : [1,1,0,0]);
204 if ( ir > 0 && (type == 1 || type == 2))
210 let ( pe = max(te, 0) )
212 [ - pe/2, 0] + ((type == 2) ? [+ir/2, d] : [+(pe-ir)/2, 0]),
213 [s1 + pe/2, 0] + ((type == 2) ? [-ir/2, d] : [-(pe-ir)/2, 0])
216 translate([io + (t1 + t2)*i, 0] + mcr_o)
function defined_e_or(v, i, d)
Returns an element from an iterable if it exists, or a default value if not.
function select_ci(v, i, l=true)
Select specified element from list or return a default.
function polygon_round_eve_all_p(c, vr=0, vrm=1, vfn, w=true, cw=true)
Compute coordinates that round all of the vertices between each adjacent edges in 2D.
function triangle_sas2sss(v)
Compute the side lengths of a triangle given two sides and the included angle.
function triangle2d_sss2ppp(v, a=x_axis_ci, cw=true)
Compute a set of vertex coordinates for a triangle given its side lengths in 2D.
module joint2d_dovetail(t=1, d=1, w=10, o=0, type=0, trim=false, center=false, align)
Create 2D edge profiles for dovetail joint construction.
module pg_rectangle(size=1, o, vr, vrm=1, vfn, center=false)
A polygon rectangle with vertex rounding.