94 [
"fins", [3, 270, 3, 3/4]],
123 [
"pwsn", [5.75, 2.5]],
125 [
"mtab", [4, 25, 4]],
128 [
"mslot", [4, [1, 1, 4]]],
156 [
"mss",
length(3+9/32,
"in")],
157 [
"rmsd",
length( 1/8,
"in")],
158 [
"rmsh",
length( 3/32,
"in")],
159 [
"rshc",
length( 5/16,
"in")],
160 [
"rmth",
length( 1/16,
"in")]
181 [
"drpo",
length(1+1/2,
"in")],
182 [
"rpd",
length(1+3/8,
"in")],
183 [
"rpfl",
length(1+5/32,
"in")],
185 [3.51, 7.50, 2.5, 1/2]]
272 (s == 1) ? [wth*1/3, [wth*2/3, [1, 1-bs]]]
273 : (s == 2) ? [wth*1/3, [wth*2/3, [
for (s=[0:1/32:1/8]) 1-pow(s,2)]]]
274 : (s == 3) ? [[wth*4/5, [1, 1+bs]], [wth*1/5, 1+bs]]
275 : (s == 4) ? [[wth*4/5, [
for (s=[0:1/32:1/8]) 1+pow(s,2)]], [wth*1/5, 1+pow(1/8,2)]]
290 function pczo ( d = 0 )
295 wth + (is_list(d) ?
second(d) : d) * 5/4 + zo;
310 translate([0, 0, pwct -
eps*2])
311 clamp_cg(size=pwcd, clamp=[1, pwzo, [pwsd,undef,pwsh,pwsn], pwct, pwcp], wth=0, mode=2);
315 module enclosure_box()
323 function piac_to_piab(pia)
331 a = i[1], ax = a[0], ay = a[1],
332 m = i[2], mx = m[0], my = m[1],
341 [is_undef(ax) ? undef : -ax, ay],
342 [is_undef(m) ? undef : -mx, my],
343 is_undef(r) ? undef : -r,
344 [h0[0], h0[1], h0[2], mphda, h0[4], h0[5], h0[6]],
377 translate([
limit(z,-1,+1)*iw/2 + m, il/2 + wth -
eps*2, 0])
383 translate([iw/2 + wth -
eps*2,
limit(z,-1,+1)*il/2 + m, 0])
389 translate([
limit(z,-1,+1)*iw/2 + m, -(il/2 + wth -
eps*2), 0])
395 translate([-(iw/2 + wth -
eps*2),
limit(z,-1,+1)*il/2 + m, 0])
403 module mount_slots(m)
435 module internal_wire_passage()
449 z = iw/2 - iwpd/2 - wth,
450 s = (iwps>0) ? 1 : -1,
451 o = (iwps>0) ? rscl : -lscl
456 nc = (oscl>0) ? cols : cols-1;
457 zc = -il/2 - wth + iscl;
464 for (i=[0:rows-1], j=[0 : nc])
465 translate([zr - i*sr * iwps, zc + j*sc, zo])
467 cylinder(d=iwpd, h = wth+
eps*8, center=true);
503 nc = (oscl>0) ? cols : cols-1,
504 zc = -il/2 - wth + iscl,
513 for (j=[0 : nc]) [0, zc + j*sc],
540 zr = -iw/2 + roww/2 + lscl,
543 zc = iscl + (dlts - mss)/2,
548 p1 = [u, u, u, u, -rmth -(cdms?0:rmsh)],
556 for (i=[0:rows-1], j=[0:cols-1])
557 [2, [0, -1], [zr + i*sr, zc + j*sc, 0], 180, h0, u, p1, f ],
558 for (i=[0:rows-1], j=[0:cols-1])
559 [2, [0, -1], [zr + i*sr, zc + j*sc + dc, 0], 000, h0, u, p1, f ],
565 if (
is_defined(piac) && mpc2b ) for (i=piac_to_piab(piac)) i
585 h = ih, size = [iw, il],
586 vrm = evrm, vr = evr,
603 internal_wire_passage();
606 translate([pwxo, -il/2-wth/2, pwzo]) rotate([90, 0, 0])
607 clamp_cg(size=pwcd, wth=wth*4, mode=0);
617 translate([0, logod - il/2, 0])
618 mirror([0, 1, 0]) rotate([0, 0, 180])
619 omdl_logo(d=logod, b=true, t=true, a=1, $fn=36);
629 translate([pwxo, -il/2-wth/2, pwzo]) rotate([90, 0, 0])
630 clamp_cg(size=pwcd, clamp=[pwcs, pwzo, [pwsd,undef,pwsh,pwsn], pwct, pwcp],
cone=pwcs+1, wth=wth, mode=1);
638 echo(str( parent_module(0),
"(): power cord hole size = ", pwcd ));
643 module enclosure_cover()
649 module cover_round_cut_duplex()
652 for (i=[0:rows-1], j=[0 : cols-1])
653 translate([zr - i*sr, zc + j*sc, zo])
662 translate([0, i*mss/2, 0])
676 translate([0, 0, rmsh/2])
681 l = zh + rmsh +
eps*4,
695 translate([0, i * drpo/2])
701 translate([0, j * (rpd/2 + rpfl)/2])
702 square([rpd, rpd/2], center=true);
709 module cover_stabilizers()
714 for (i=[0:rows-1], j=[0 : cols-1])
715 translate([zr - i*sr, zc + j*sc, zo])
722 translate([0, 0, zo])
726 rectangle([4, 1]*rshc, vr=rshc/4, vrm=0, center=
true);
729 translate([0, i * (mss+rshc)/2])
734 co = [0,1/3]*rshc * -i,
749 ih = max([ wth,
second(l()) ]);
757 is_undef(piac) ? undef
758 : [pmode, [for (i=piac) i]];
769 zr = iw/2 - roww/2 - lscl;
772 zc = -il/2 - wth + iscl + dlts/2;
792 h = ih, size = [iw, il],
793 vrm = evrm, vr = evr,
809 cover_round_cut_duplex();
819 module check_cm(name, mc, md)
828 "bad entry in map [", name,
"] = [", k,
",",
map_get_value(mc, k),
"]"
846 lscl + roww * rows + rscl;
854 iscl - wth * 3/2 + cols * (dlts + wth) + oscl;
877 translate([-(iw/2 + ps), 0, 0])
881 translate([+(iw/2 + ps), -(il/2 + ps), 0])
885 translate([+(iw/2 + ps), 0, 0])
module log_warn(m)
Output warning message to console.
origin3d
<point-3d> The origin point coordinate in 3-dimensional Euclidean space.
eps
<decimal> Epsilon, small distance to deal with overlapping shapes.
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)
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 first(v)
Return the first element of an iterable value.
function limit(v, l, u)
Limit a list of numbers between an upper and lower bounds.
function strl(v)
Convert a list of values to a concatenated string.
function map_get_value(m, k)
Get the map value associated with a key.
function map_get_keys(m)
Get a list of all map keys.
module map_check(m, verbose=false)
Perform basic format checks on a map and output errors to console.
function map_exists(m, k)
Test if a key exists.
function is_defined(v)
Test if a value is defined.
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 omdl_logo(r=5, c=false, b=false, t=false, td="ltr", a=0, d)
Standard omdl logo.
module clamp_cg(size, clamp, cone, grip, wth=0, gap=10, mode)
A clamp, bushing, and/or grip for wire/hose wall penetrations.
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.
power_strip_sg_default_box
<map> A single gang electrical device box configuration.
module power_strip_sg(cols=1, rows=1, mode=7, verb=1, cm_box=power_strip_sg_default_box, cm_mount=power_strip_sg_default_mount, cm_cover=power_strip_sg_default_cover)
A power strip generator for single gang electrical receptacles.
power_strip_sg_default_mount
<map> A single gang electrical device mount configuration.
power_strip_sg_default_cover
<map> A single gang duplex receptacle cover configuration.
module project_box_rectangle(wth, h, size, vr, vrm, inset, lid, lip, rib, wall, post, align, mode=0, verb=0)
A rectangular box maker for project boxes, enclosures and housings.
module rectangle_c(size, core, t, co, cr=0, vr, vr1, vr2, vrm=0, vrm1, vrm2, center=false)
A rectangle with a removed rectangular core.
module rectangle(size, vr, vrm=0, center=false)
A rectangle with corner rounds or chamfers.
module cone(r=1, h, d, vr)
A cone.
function length(v, from=length_unit_default, to=length_unit_base, d=1)
Convert a value from from one units to another with dimensions.