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])
391 module multi_mss(m=0)
402 align=[4, 0, align_z],
408 module cover() { multi_mss(0); }
409 module slot() { multi_mss(1); }
568 module round_post_fins(rd, rh)
571 function fin_embed(r, w) =
577 r - sqrt( pow(r,2) - pow(w/2, 2) - pow(d/2, 2) );
590 d_vr = ( t == 0 ) ? min(h, l)/2 : min(l, w)/2;
602 p = !is_string(vrm) ? vrm
603 : (vrm ==
"p1") ? [10, 0, 9]
604 : (vrm ==
"p2") ? [4, 0, 3]
605 : (vrm ==
"p3") ? [6, 0, 7]
606 : (vrm ==
"p4") ? [7, 0, 7]
607 : (vrm ==
"p5") ? [0, 0, 1]
608 : (vrm ==
"p6") ? [0, 0, 5]
615 rotate([90, 0, da/c * i + 180])
616 translate([ -rd/2 - l + fin_embed(rd/2, w), 0, 0])
629 p = !is_string(vrm) ? vrm
630 : (vrm ==
"p1") ? [0, 10, 9, 0]
631 : (vrm ==
"p2") ? [0, 4, 3, 0]
632 : (vrm ==
"p3") ? [0, 8, 7, 0]
633 : (vrm ==
"p4") ? [0, 5, 5, 0]
634 : (vrm ==
"p5") ? [0, 1, 1, 0]
635 : (vrm ==
"p6") ? [0, 9, 10, 0]
642 rotate([0, 0, da/c * i])
643 translate([rd/2 + l/2 - fin_embed(rd/2, w), 0, 0])
663 p = !is_string(vrm) ? vrm
664 : (vrm ==
"p1" ) ? [0, 5, 10, 0]
665 : (vrm ==
"p2" ) ? [0, 0, 10, 0]
666 : (vrm ==
"p3" ) ? [0, 5, 0, 0]
667 : (vrm ==
"p4" ) ? [0, 1, 0, 0]
668 : (vrm ==
"p5" ) ? [0, 9, 0, 0]
669 : (vrm ==
"p6" ) ? [0, 7, 0, 0]
670 : (vrm ==
"p7" ) ? [0, 1, 4, 0]
671 : (vrm ==
"p8" ) ? [0, 1, 8, 0]
672 : (vrm ==
"p9" ) ? [0, 5, 5, 0]
673 : (vrm ==
"p10") ? [0, 9, 10, 0]
674 : (vrm ==
"p11") ? [0, 1, 1, 0]
675 : (vrm ==
"p12") ? [0, 3, 4, 0]
676 : (vrm ==
"p13") ? [0, 7, 8, 0]
695 round_post_fins(pd_min, ph);
708 translate([0, 0, ph+
eps*2])
709 screw_bore(d=d, l=l, h=h, n=n, s=s, f=f, a=1);
719 translate([0, 0, ph+
eps*2])
731 c = [pd_max, pd_max, ph] * s;
735 translate([0, 0, -
third(c)/2])
736 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_slot_md(wth, screw, cover, size, align, mode, f, slots=1)
A multi-directional 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.