117 dx = d*3 +
defined_e_or(t, 0, 0) + (is_undef(brace) ? 0 : wth*2);
126 rm = vrm == 1 ? [[5,5,0,0], [10,0,9]]
127 : vrm == 2 ? [[5,5,10,9], [10,0,9]]
128 : vrm == 3 ? [[1,1,0,0], [4,0,3]]
129 : vrm == 4 ? [[1,1,4,3], [4,0,3]]
132 translate([0, y/2, wth/2])
155 translate([-wth/2 -sz -
eps*2, -y/2, (x/2 - wth/2)*i])
235 translate([sl/2*x, 0, sd + cto - coa])
236 cylinder(d=hd + ctt*2 - coa, h=
eps);
238 translate([sl/2*x, 0, coa])
239 cylinder(d=hd + ctb*2 - coa, h=
eps);
246 translate([0, 0, -
eps*4])
253 translate([sl/2, 0, 0])
254 cylinder(d=hd, h=sd);
285 [0, -sl-hd-ctt*2, -sl-hd-ctb*2, -sl-hd, -sl, sl, sl+ld, sl+hd, sl+hd+ctb*2, sl+hd+ctt*2]/2,
286 [0, -hd-ctt*2, -hd-ctb*2, -hd, -ld, ld, hd, hd+ctb*2, hd+ctt*2]/2,
287 [0, -wth/2, -wth+hb, -wth, -sd, -sd-cto]
295 translate([align_x, align_y, align_z])
450 module round_post_fins(rd, rh)
453 function fin_embed(r, w) =
459 r - sqrt( pow(r,2) - pow(w/2, 2) - pow(d/2, 2) );
472 d_vr = ( t == 0 ) ? min(h, l)/2 : min(l, w)/2;
484 p = !is_string(vrm) ? vrm
485 : (vrm ==
"p1") ? [10, 0, 9]
486 : (vrm ==
"p2") ? [4, 0, 3]
487 : (vrm ==
"p3") ? [6, 0, 7]
488 : (vrm ==
"p4") ? [7, 0, 7]
489 : (vrm ==
"p5") ? [0, 0, 1]
490 : (vrm ==
"p6") ? [0, 0, 5]
497 rotate([90, 0, da/c * i + 180])
498 translate([ -rd/2 - l + fin_embed(rd/2, w), 0, 0])
511 p = !is_string(vrm) ? vrm
512 : (vrm ==
"p1") ? [0, 10, 9, 0]
513 : (vrm ==
"p2") ? [0, 4, 3, 0]
514 : (vrm ==
"p3") ? [0, 8, 7, 0]
515 : (vrm ==
"p4") ? [0, 5, 5, 0]
516 : (vrm ==
"p5") ? [0, 1, 1, 0]
517 : (vrm ==
"p6") ? [0, 9, 10, 0]
524 rotate([0, 0, da/c * i])
525 translate([rd/2 + l/2 - fin_embed(rd/2, w), 0, 0])
545 p = !is_string(vrm) ? vrm
546 : (vrm ==
"p1" ) ? [0, 5, 10, 0]
547 : (vrm ==
"p2" ) ? [0, 0, 10, 0]
548 : (vrm ==
"p3" ) ? [0, 5, 0, 0]
549 : (vrm ==
"p4" ) ? [0, 1, 0, 0]
550 : (vrm ==
"p5" ) ? [0, 9, 0, 0]
551 : (vrm ==
"p6" ) ? [0, 7, 0, 0]
552 : (vrm ==
"p7" ) ? [0, 1, 4, 0]
553 : (vrm ==
"p8" ) ? [0, 1, 8, 0]
554 : (vrm ==
"p9" ) ? [0, 5, 5, 0]
555 : (vrm ==
"p10") ? [0, 9, 10, 0]
556 : (vrm ==
"p11") ? [0, 1, 1, 0]
557 : (vrm ==
"p12") ? [0, 3, 4, 0]
558 : (vrm ==
"p13") ? [0, 7, 8, 0]
577 round_post_fins(pd_min, ph);
590 translate([0, 0, ph+
eps*2])
591 screw_bore(d=d, l=l, h=h, n=n, s=s, f=f, a=1);
601 translate([0, 0, ph+
eps*2])
613 c = [pd_max, pd_max, ph] * s;
617 translate([0, 0, -
third(c)/2])
618 cube(c, center=
true);
eps
<decimal> Epsilon, small distance to deal with overlapping shapes.
function defined_e_or(v, i, d)
Return an element of an iterable when it exists or a default value otherwise.
function third(v)
Return the third element of an iterable value.
function second(v)
Return the second element of an iterable value.
function defined_eon_or(v, i, d)
Return the list element or scalar numeric value, if either is defined, otherwise the default value.
function first(v)
Return the first element of an iterable value.
function select_ci(v, i, l=true)
Select specified element from list or return a default.
function defined_or(v, d)
Return given value, if defined, or a secondary value, if primary is not defined.
function is_defined(v)
Test if a value is defined.
function polygon_regular_perimeter(n, r, a)
Compute the perimeter of an n-sided regular polygon in 2D.
function get_fn(r)
Return facets number for the given arc radius.
module screw_bore(d=1, l=1, h, n, t, s, f, a)
Flat and beveled-head fastener bore with nut, nut slot, and bore tolerance.
module screw_bore_tsf(d=1, l=1, t, a)
Gapped fastener bore with engagement cylinders for self-forming threads.
module mount_screw_post(post, screw, bore_sft, fins, cut)
A screw mount post with screw bore and optional fins.
module mount_screw_slot(wth, screw, cover, size, align, mode, f)
A screw mount slot with optional cover envelope.
module mount_screw_tab(wth, screw, brace, size, vr, vrm)
A mount tab with screw hole and support brace.
module pg_trapezoid(b=1, h, l=1, a=90, o=origin2d, vr, vrm=1, vfn, center=false)
A polygon trapezoid with individual vertex rounding and arc facets.
module pg_triangle_sas(v, a=x_axis_ci, o, vr, vrm=1, vfn, cm=0)
A polygon triangle specified by size-angle-size with vertex rounding.
module pg_rectangle(size=1, o, vr, vrm=1, vfn, center=false)
A polygon rectangle with vertex rounding.