199 ww = sw * (1 + gap/100);
200 wh = sh * (1 + gap/100);
202 wmax = max([ww, wh]);
203 wmin = min([ww, wh]);
206 wt = is_list(size) && (len(size) > 1) ? 1 : 0;
208 wr = (wt == 0) ? ww/2 : wmin/4;
209 wl = (wt == 0) ? undef : [ww-wr*2, wh-wr*2];
220 square([
eps, wth+
eps*8], center=true);
253 pbh = php * wh / 100;
254 pbw = pwp * cd / 100;
256 wsw = ww/2 * (1+5/10);
269 h_bvr = [1, 1/2, 0, 1] * wmin/4;
270 h_bvrm = [1, 1, 0, 1];
272 bp = concat( [
for (i=h_bp) i], [
for (i=
reverse(h_bp)) [-i.x, i.y]] );
273 bvr = concat( [
for (i=h_bvr) i], [
for (i=
reverse(h_bvr)) i] );
274 bvrm = concat( [
for (i=h_bvrm) i], [
for (i=
reverse(h_bvrm)) i] );
288 h_svr = [1, 1/2, 1/2, 1] * wmin/4;
289 h_svrm = [5, 1, 1, 1];
291 sp = concat( [
for (i=h_sp) i], [
for (i=
reverse(h_sp)) [-i.x, i.y]] );
292 svr = concat( [
for (i=h_svr) i], [
for (i=
reverse(h_svr)) i] );
293 svrm = concat( [
for (i=h_svrm) i], [
for (i=
reverse(h_svrm)) i] );
297 for (s = is_list(s) ? s : [s])
298 rotate([0, s * 180, 0])
299 translate([0, 0, cd/2 + wth/2])
313 translate([0, wh*(gap/100), 0])
314 scale([1+(gap/200), 1, 1+
eps*4])
330 translate([x * (wsw + ssw/2), wh/2, 0])
332 screw_bore(d=sbd, l=sbl +wh/2 +
eps*8, h=sbh, n=sbn, s=sbs, a=1);
338 translate([0, +wh/2, i * (cd/2-pbw)])
341 rhombus( [pbw, pbh*2], center=true);
345 translate([0, -wh/2, 0])
348 rhombus( [pbw, pbh*2], center=true);
368 vr = [3, 1, 1, 0] * min([w, h])/4;
373 for (s = is_list(s) ? s : [s])
374 rotate([0, s * 180, 0])
375 translate([0, 0, wth/2])
417 vr = [3, 1, 0, 0, 1, 1, 1, 0] * min([w, h])/4;
418 vrm = [3, 1, 0, 0, 1, 1, 1, 0];
422 for (s = is_list(s) ? s : [s])
423 rotate([0, s * 180, 0])
426 translate([0, 0, wth/2])
434 translate([cw/2, 0, wth/2 + h - ch/2])
435 cube([cw, ct, ch +
eps*4], center=true);
570 module open_tunnel_access()
579 translate([0, +
eps*2, 0])
679 translate([0, sy/2 +
eps*2, 0])
684 translate([0, (sy-wy)/2 +
eps*2, 0])
696 translate([0, zto, zio] + concat(to, 0))
703 l = [ztx, zty] - 2*[cr, cr] + [zy, zy] + ta
714 translate([0, -sy/2 + zty/4 -
second(to)/2, 0])
719 size = [ztx + zy*2 +
first(ta), zx],
729 for (zio = zi, i = [-1, 1])
730 translate([0, sy/2 - wy, zio + i * po/2])
735 rhombus( [pw, ph*2], center=
true);
736 translate([0, -ph/2])
737 square([pw, ph], center=true);
origin2d
<point-2d> The origin point coordinate in 2d Euclidean space.
eps
<decimal> Epsilon, small distance to deal with overlapping shapes.
function binary_iw2i(v, s, w)
Decode the binary bits of a bit window to an integer value.
function binary_bit_is(v, b, t=1)
Test if a binary bit position of an integer value equals a test bit.
function defined_e_or(v, i, d)
Returns an element from an iterable if it exists, or a default value if not.
function second(v)
Return the second element of an iterable value.
function first(v)
Return the first element of an iterable value.
function reverse(v)
Reverse the elements of an iterable value.
function select_ci(v, i, l=true)
Select specified element from list or return a default.
function is_defined(v)
Test if a value is defined.
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.
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 clamp_zt_1p(size=1, ztie=1, clamp, tunnel, vr, vrm, align, mode=1)
A one piece zip tie clamp to secure wires or provide strain relief.
module clamp_cg(size=1, clamp, cone, grip, wth=0, gap=10, mode)
A clamp, bushing, and/or grip for wire, hose, and/or pipe wall penetrations.
module rhombus(size=1, vr, center=false)
A rhombus.
module cone(size=1, vr, center=false)
A cone.
module pg_rectangle(size=1, o, vr, vrm=1, vfn, center=false)
A polygon rectangle with vertex rounding.