783 module construct_holes()
788 bsize = [szint_x, szint_y, szint_z] + [wth, wth, wth];
796 s_type = is_list(shape) ?
first(shape) : shape;
797 s_argv = is_list(shape) ?
tailn(shape, 1) : undef;
809 h = (h_p < 0) ? bsize[abs(h_p+1)] + wth +
eps*8
810 : (h_p == 0) ? max(bsize) + wth +
eps*8
814 translate([0, 0, bsize.z/2])
821 echo(shape=shape, type=s_type, argv=s_argv);
829 echo(
strl([
"hole: instances = ", insts]));
834 module construct_shapes()
839 bsize = [szint_x, szint_y, szint_z] + [wth, wth, wth];
846 s_type = is_list(shape) ?
first(shape) : shape;
847 s_argv = is_list(shape) ?
tailn(shape, 1) : undef;
850 translate([0, 0, bsize.z/2])
856 echo(shape=shape, type=s_type, argv=s_argv);
863 echo(
strl([
"shape: instances = ", insts]));
868 module construct_exterior_walls( envelop=
false )
874 : let( sf=wall_h/h_h )
875 [
for (e=h) !is_list(e) ? e * sf : [
first(e) * sf,
second(e) ] ];
877 if ( mode_scale_io ==
true )
882 pg_rectangle(wall_xy + 0*[wth, wth], vr=vr, vrm=vrm_ci, center=
true);
883 pg_rectangle(wall_xy - 2*[wth, wth], vr=vr, vrm=vrm_ci, center=
true);
891 pg_rectangle(wall_xy + 0*[wth, wth], vr=vr, vrm=vrm_ci, center=
true);
893 translate([0, 0, -10*
eps/2])
895 pg_rectangle(wall_xy - 2*[wth, wth], vr=vr, vrm=vrm_ci, center=true);
904 : let( sf = [
for (e=h) !is_list(e) ? 1 : [
for (f=
second(e)) !is_list(f) ? f :
first(f) ] ] )
909 : let( sf = [
for (e=h) !is_list(e) ? 1 : [
for (f=
second(e)) !is_list(f) ? f :
second(f) ] ] )
912 echo(
strl([
"wall: extrusion scale factors [x-min, x-max] = ", [min(sf_x), max(sf_x)]]));
913 echo(
strl([
"wall: extrusion scale factors [y-min,y- max] = ", [min(sf_y), max(sf_y)]]));
914 echo(
strl([
"wall: height (ignoring ribs) = ", wall_h]));
915 echo(
strl([
"wall: total interior height (ignoring ribs) = ", wall_h + lip_h]));
920 module construct_lips( envelop=
false )
934 lip_sc_f =
defined_e_or (lip_sc, 3, [0, 3.5/5, 4.5/5, 1, 4.5/5, 3.5/5, 0]);
937 function el_mss_profile
951 fx = (2 * wth * lip_tw / 100) / wall_xy.x,
952 fy = (2 * wth * lip_tw / 100) / wall_xy.y,
957 s1 = [1, [1 - i*fx, 1 - i*fy]],
958 s2 = [for (j=f) [1 - i*fx*(1-j*m), 1 - i*fy*(1-j*m)]]
961 [ [h1, s1],
if (s ) [h2, s2] ]
964 translate( [0, 0, wall_h/2] )
972 lip_hr = lip_h +
eps*10,
975 ep_it = el_mss_profile( lip_ha, 1, +1 ),
976 ep_ot = el_mss_profile( lip_hr, 0, +1 ),
977 ep_ib = el_mss_profile( lip_ha, 0, +1 ),
978 ep_ob = el_mss_profile( lip_hr, 1, +1 ),
981 ep_pt = el_mss_profile( lip_hr, 1, -1 ),
982 ep_ct = el_mss_profile( lip_ha, 0, -1 ),
983 ep_pb = el_mss_profile( lip_hr, 0, -1 ),
984 ep_cb = el_mss_profile( lip_ha, 1, -1 ),
988 ws_oi = wall_xy - 2*[wth, wth] * lip_bw/100,
989 ws_io = wall_xy - 2*[wth, wth] * (1-lip_bw/100),
990 ws_ii = wall_xy - 2*[wth, wth]
993 [0, 1, +1, ep_it, lip_hr, ws_io, ws_ii],
994 [1, 0, +1, lip_ha, ep_ot, ws_oo, ws_oi],
995 [2, 1, -1, ep_ib, lip_hr, ws_io, ws_ii],
996 [3, 0, -1, lip_ha, ep_ob, ws_oo, ws_oi],
998 [4, 1, +1, ep_it, ep_pt, ws_oi, ws_io],
999 [5, 0, +1, ep_ct, lip_hr, ws_io, ws_ii],
1000 [6, 1, -1, ep_ib, ep_pb, ws_oi, ws_io],
1001 [7, 0, -1, ep_cb, lip_hr, ws_io, ws_ii]
1020 sr = lip_sr[
last(search(m, lip_sr, 0, 0)) ];
1025 es = [wall_xy.x * ee.x, wall_xy.y * ee.y] / 2;
1026 et = [es.x * eo.x, es.y * eo.y] / 2;
1028 translate([0, 0, (wall_h + lip_h -
eps)/2 * tb])
1043 echo(
strl([
"lip: mode = ", lip_m]));
1044 echo(
strl([
"lip: height = ", lip_h]));
1045 echo(
strl([
"lip: base width percentage = ", lip_bw]));
1046 echo(
strl([
"lip: top reduction percentage = ", lip_tw]));
1047 echo(
strl([
"lip: snap = ", lip_sc]));
1048 echo(
strl([
"lip: section removal = ", lip_sr]));
1053 module construct_lid()
1056 translate([0, 0, -
eps])
1058 pg_rectangle([encl_x, encl_y] + 0*[wth, wth], vr=vr, vrm=vrm_ci, center=true);
1062 echo(
strl([
"lid: extrusion = ", lid]));
1063 echo(
strl([
"lid: height = ", lid_h]));
1068 module construct_ribs()
1074 max_x =
first( wall_xy) - 2*(wth -
eps);
1075 max_y =
second(wall_xy) - 2*(wth -
eps);
1078 max_h = wall_h + min(2,
binary_iw2i(rib_m, 5, 2)) * lip_h;
1084 rib_edx = [
for (x=[0:1/
get_fn(1)/2:1]) [2*sqrt(1-pow(x,2)), 1]];
1086 rib_edy = [
for (e=rib_edx)
reverse(e)];
1088 rib_sd =
defined_e_or(rib, 1, [ wth, [[wth, rib_edx]], [[wth, rib_edy]] ] );
1102 crc_x = max([0, floor(max_x/rib_w * rcp_x / 100)]);
1103 crc_y = max([0, floor(max_y/rib_w * rcp_y / 100)]);
1104 crc_z = max([0, floor(max_h/rib_w * rcp_z / 100)]);
1124 [ 0, [max_x, max_y], [cnt_x, cnt_y], [[0, 0, 0], [0, 0, 0]] ],
1125 [ 1, [max_y, max_h], [cnt_y, cnt_z], [[90, 0, -90], [max_x/2, 0, max_h/2]] ],
1126 [ 2, [max_x, max_h], [cnt_x, cnt_z], [[90, 0, 0], [0, max_y/2, max_h/2]] ],
1127 [ 3, [max_y, max_h], [cnt_y, cnt_z], [[90, 0, 90], [-max_x/2, 0, max_h/2]] ],
1128 [ 4, [max_x, max_h], [cnt_x, cnt_z], [[-90, 0, 0], [0, -max_y/2, max_h/2]] ],
1151 translate([(sx/nx*(1-nx)/2) + (sx/nx * i), 0, 0])
1153 square([rib_w, sy], center=true);
1158 translate([0, (sy/ny*(1-ny)/2) + (sy/ny * i), 0])
1160 square([sx, rib_w], center=true);
1168 rib_hxd =
sum( [
for (e=rib_hx) is_list(e) ?
first(e) : e] );
1169 rib_hyd =
sum( [
for (e=rib_hy) is_list(e) ?
first(e) : e] );
1173 rib_rwh = wall_h + lip_h
1174 - max( 0, max([rib_hxd, rib_hyd]) +
third(rib_lo) )
1177 echo(
strl([
"rib: mode = ", rib_m]));
1178 echo(
strl([
"rib: width = ", rib_w]));
1179 echo(
strl([
"rib: extrusion x = ", rib_hx]));
1180 echo(
strl([
"rib: height x = ", rib_hxd]));
1181 echo(
strl([
"rib: extrusion y = ", rib_hy]));
1182 echo(
strl([
"rib: height y = ", rib_hyd]));
1183 echo(
strl([
"rib: coverage [x, y, z] = ", [rcp_x, rcp_y, rcp_z]]));
1184 echo(
strl([
"rib: count [x, y, z] = ", [cnt_x, cnt_y, cnt_z]]));
1186 echo(
strl([
"rib: global offset = ", rib_lo]));
1187 echo(
strl([
"rib: remaining wall height = ", rib_rwh]));
1192 module construct_interior_walls()
1206 max_x =
first( wall_xy) - 2*(wth -
eps);
1207 max_y =
second(wall_xy) - 2*(wth -
eps);
1210 max_h = wall_h + min(2,
binary_iw2i(wall_m, 8, 2)) * lip_h;
1217 (i == 1) ? [ 9, 10, 9, 10]
1218 : (i == 2) ? [ 3, 4, 3, 4]
1219 : (i == 3) ? [ 7, 8, 7, 8]
1229 [
for (x=[0:1/
get_fn(1)/2:1]) [1,sqrt(1+
eps-pow(x,2))]],
1230 [
for (x=[1:-1/
get_fn(1)/2:1/2]) [1,1-sqrt(1-pow(x,2))]],
1232 [
for (x=[0:1/
get_fn(1)/2:1]) [1,sqrt(1+
eps+pow(x,2))]],
1233 [
for (x=[1:-1/
get_fn(1)/2:1/2]) [1,1+sqrt(1-pow(x,2))]],
1238 s_wt_rm =
select_ci( cfg_wt_rm, wt_rm_i,
true );
1239 cfg_rt = [def_dw/2, s_wt_rm];
1243 s_wb_rm =
select_ci( cfg_wt_rm, wb_rm_i,
true );
1244 cfg_rb = [def_dw/2,
reverse(s_wb_rm)];
1248 (wt_rm_i > 0 && wb_rm_i == 0) ? [max_h - def_dw/2, cfg_rt]
1249 : (wt_rm_i == 0 && wb_rm_i > 0) ? [cfg_rb, max_h - def_dw/2]
1250 : (wt_rm_i > 0 && wb_rm_i > 0) ? [cfg_rb, max_h - def_dw, cfg_rt]
1284 type_m = is_list(inst_m) ?
1291 tdef_s = (inst_t == 0) ?
1296 tdef_he = !is_list(def_he) ?
1307 tdef_vr = !is_list(def_vr) ?
1311 :
shift_cd(def_vr, n=-1, r=
false, d=
false);
1314 tdef_vrm = !is_list(def_vrm) ?
1318 :
shift_cd(def_vrm, n=+1, r=
false, d=
false);
1340 echo(
strl([
"wall-inst: [type, move, scale, rotation, size, he, vr, vrm] = ",
1341 [inst_t, inst_m, inst_f, inst_r, s, he, vr, vrm]]));
1347 wall_cnt = is_list(inst_l) ? len(inst_l) : 1;
1349 echo(
strl([
"wall: configuration = ", config]));
1350 echo(
strl([
"wall: mode = ", wall_m]));
1352 echo(
strl([
"wall: max [x, y, h] = ", [max_x, max_y, max_h]]));
1354 echo(
strl([
"wall: default width = ", def_dw]));
1355 echo(
strl([
"wall: default extrusion = ", def_he]));
1356 echo(
strl([
"wall: default edge rounding = ", def_vr]));
1357 echo(
strl([
"wall: default edge rounding mode = ", def_vrm]));
1359 echo(
strl([
"wall: count = ", wall_cnt]));
1361 echo(
strl([
"wall: global offset = ", wall_lo]));
1366 module construct_posts( add=
false, remove=
false )
1380 cfg_p_vr_sf = (cfg_rbst ==
true) ? [0, 1/2, 1/2, 0] : [0, 1/2, 3/2, 0];
1381 cfg_p_vrm_filet = (cfg_rbst ==
true) ? [0, 1, 1, 0] : [0, 1, 4, 0];
1382 cfg_p_vrm_bevel = (cfg_rbst ==
true) ? [0, 5, 5, 0] : [0, 5, 10, 0];
1384 cfg_f0_vr_sf = [2, 0, 1];
1385 cfg_f0_vrm_filet = [4, 0, 3];
1386 cfg_f0_vrm_bevel = [10, 0, 9];
1388 cfg_f1_vr_sf = [0, 1, 1, 0];
1389 cfg_f1_vrm_filet = [0, 4, 3, 0];
1390 cfg_f1_vrm_bevel = [0, 10, 9, 0];
1395 (i == 1) ? cfg_p_vrm_bevel
1396 : (i == 2) ? cfg_p_vrm_filet
1401 (i == 1) ? cfg_f0_vrm_bevel
1402 : (i == 2) ? cfg_f0_vrm_filet
1406 (i == 1) ? cfg_f1_vrm_bevel
1407 : (i == 2) ? cfg_f1_vrm_filet
1417 lip_h_t = ((
binary_bit_is(post_m, 8, 1) ? 1 : 0) + 1) * lip_h;
1420 cfg_p1_h = (
binary_bit_is(post_m, 7, 1) ? lip_h_t : 0) + wall_h;
1421 cfg_p2_h = (
binary_bit_is(post_m, 7, 0) ? lip_h_t : 0) + wall_h;
1426 max_x =
first( wall_xy) - 2*(wth -
eps);
1427 max_y =
second(wall_xy) - 2*(wth -
eps);
1428 max_h = wall_h + lip_h_t;
1460 def_h1_d_c = def_h0_d
1464 def_p1_d_c = def_h0_d
1468 def_h2_d_c = def_h0_d
1472 def_p2_d_c = def_h0_d
1496 def_p1_vr =
defined_e_or(def_p1, 5, cfg_p_vr_sf * wth);
1510 def_h2_vr =
defined_e_or(def_h2, 5, cfg_p_vr_sf * wth/2);
1524 def_p2_vr =
defined_e_or(def_p2, 5, cfg_p_vr_sf * wth);
1538 def_f0_vr =
defined_e_or(def_f0, 5, cfg_f0_vr_sf * wth);
1547 def_f1_vr =
defined_e_or(def_f1, 5, cfg_f1_vr_sf * wth);
1557 module remove_cylinder ( d, r, eps_h=0, eps_d=0 )
1573 echo(
strl([
"post-inst-cylinder-remove: [d, r, eps_h, eps_d] = ", [d, r, eps_h, eps_d]]));
1575 translate([0, 0, ho - eps_h/2])
1579 x = h; y = h; z = d;
1582 cylinder(d=d + eps_d, h=h + eps_h);
1586 translate([0, -d/2, 0])
1587 translate([0, 0, h])
1589 translate([-x/2, 0, 0])
1590 cube([x, y, z], center=false);
1594 translate([0, -d/2, 0])
1596 translate([-x/2, 0, -z])
1597 cube([x, y, z], center=false);
1602 module construct_fins(d, h, t, f)
1607 function fin_embed(r, w) =
1613 r - sqrt( pow(r,2) - pow(w/2, 2) - pow(d/2, 2) );
1628 echo(
strl([
"post-inst-cylinder-fins: [d, h, t, f] = ", [d, h, t, f]]));
1630 f_in = fin_embed(d/2, w);
1637 rotate([90, 0, da/c * i + 180])
1638 translate([-d/2 - b + f_in, 0, 0])
1649 rotate([0, 0, da/c * i])
1650 translate([b/2 + d/2 - f_in, 0, 0])
1660 module construct_cylinder ( en, c, r, ft, f, eps_h=0 )
1673 echo(
strl([
"post-inst-cylinder: [c, eps_h] = ", [c, eps_h]]));
1678 translate([0, 0, ho - eps_h/2])
1685 pg_rectangle([d_adj/2, h_adj + eps_h], vr=vr, vrm=vrm);
1687 construct_fins(d_adj, h_adj, ft, f);
1691 eps_h_a = ( add == true ) ? +
eps*8 : 0;
1692 eps_h_r = ( remove == true ) ? -
eps*8 : 0;
1694 remove_cylinder(d, r, eps_h=eps_h_a + eps_h_r, eps_d=d);
1702 post_cfm = ( add ==
true && remove == false ) ?
"add"
1703 : ( add ==
false && remove ==
true ) ?
"remove"
1704 : ( add ==
true && remove == true ) ?
"add & remove"
1707 echo(
strl([
"post: construction phase = ", post_cfm]));
1733 inst_zx =
limit(inst_ax, -1, 1) * (max_x + wth)/2;
1734 inst_zy =
limit(inst_ay, -1, 1) * (max_y + wth)/2;
1735 inst_zz =
limit(inst_az, -1, 0) * lid_h;
1747 tdef_h1_d_c = (inst_pt == 0) ? def_h1_d_c : def_h2_d_c;
1748 tdef_h1_d = (inst_pt == 0) ? def_h1_d : def_h2_d;
1749 tdef_h1_h = (inst_pt == 0) ? def_h1_h : def_h2_h;
1750 tdef_h1_ho = (inst_pt == 0) ? def_h1_ho : def_h2_ho;
1751 tdef_h1_da = (inst_pt == 0) ? def_h1_da : def_h2_da;
1752 tdef_h1_ha = (inst_pt == 0) ? def_h1_ha : def_h2_ha;
1753 tdef_h1_vr = (inst_pt == 0) ? def_h1_vr : def_h2_vr;
1754 tdef_h1_vrm = (inst_pt == 0) ? def_h1_vrm : def_h2_vrm;
1756 tdef_h1_rh = (inst_pt == 0) ? def_h1_rh : def_h2_rh;
1757 tdef_h1_ro = (inst_pt == 0) ? def_h1_ro : def_h2_ro;
1758 tdef_h1_rta = (inst_pt == 0) ? def_h1_rta : def_h2_rta;
1759 tdef_h1_rba = (inst_pt == 0) ? def_h1_rba : def_h2_rba;
1762 tdef_p_d_c = (inst_pt == 0) ? def_p1_d_c : def_p2_d_c;
1763 tdef_p_d = (inst_pt == 0) ? def_p1_d : def_p2_d;
1764 tdef_p_h = (inst_pt == 0) ? def_p1_h : def_p2_h;
1765 tdef_p_ho = (inst_pt == 0) ? def_p1_ho : def_p2_ho;
1766 tdef_p_da = (inst_pt == 0) ? def_p1_da : def_p2_da;
1767 tdef_p_ha = (inst_pt == 0) ? def_p1_ha : def_p2_ha;
1768 tdef_p_vr = (inst_pt == 0) ? def_p1_vr : def_p2_vr;
1769 tdef_p_vrm = (inst_pt == 0) ? def_p1_vrm : def_p2_vrm;
1771 tdef_p_rh = (inst_pt == 0) ? def_p1_rh : def_p2_rh;
1772 tdef_p_ro = (inst_pt == 0) ? def_p1_ro : def_p2_ro;
1773 tdef_p_rta = (inst_pt == 0) ? def_p1_rta : def_p2_rta;
1774 tdef_p_rba = (inst_pt == 0) ? def_p1_rba : def_p2_rba;
1780 tdef_f_c = (inst_ft == 0) ? def_f0_c : def_f1_c;
1781 tdef_f_da = (inst_ft == 0) ? def_f0_da : def_f1_da;
1782 tdef_f_w = (inst_ft == 0) ? def_f0_w : def_f1_w;
1783 tdef_f_d_sf = (inst_ft == 0) ? def_f0_d_sf : def_f1_d_sf;
1784 tdef_f_h_sf = (inst_ft == 0) ? def_f0_h_sf : def_f1_h_sf;
1785 tdef_f_vr = (inst_ft == 0) ? def_f0_vr : def_f1_vr;
1786 tdef_f_vrm = (inst_ft == 0) ? def_f0_vrm : def_f1_vrm;
1793 h0_en = (remove ==
true);
1803 h0 = [h0_d, h0_h, h0_ho, h0_da, h0_ha, h0_vr, h0_vrm];
1810 h0r = [h0_rh, h0_ro, h0_rta, h0_rba];
1815 tdef_h1_ims = (cfg_hp_idr ==
true) ? h0_d + tdef_h1_d_c : tdef_h1_d;
1816 tdef_p_ims = (cfg_hp_idr ==
true) ? h0_d + tdef_p_d_c : tdef_p_d;
1819 h1_en = (remove ==
true);
1829 h1 = [h1_d, h1_h, h1_ho, h1_da, h1_ha, h1_vr, h1_vrm];
1836 h1r = [h1_rh, h1_ro, h1_rta, h1_rba];
1839 p_en = (add ==
true);
1849 p = [p_d, p_h, p_ho, p_da, p_ha, p_vr, p_vrm];
1856 pr = [p_rh, p_ro, p_rta, p_rba];
1867 f = [f_c, f_da, f_w, f_d_sf, f_h_sf, f_vr, f_vrm];
1874 translate([inst_zx, inst_zy, inst_zz])
1878 construct_cylinder(p_en, p, pr, inst_ft, f);
1880 construct_cylinder(h0_en, h0, h0r, eps_h=
eps*8);
1881 construct_cylinder(h1_en, h1, h1r, eps_h=
eps*8);
1885 echo(
strl([
"post-inst: [type, align, move, rotation, hole0, hole1, post, fins] = ",
1886 [inst_t, inst_a, inst_m, inst_r, inst_h0, inst_h1, inst_p, inst_f]]));
1893 post_cnt = is_list(inst_l) ? len(inst_l) : 1;
1895 echo(
strl([
"post: configuration = ", config]));
1896 echo(
strl([
"post: mode = ", post_m]));
1898 echo(
strl([
"post: count = ", post_cnt]));
1903 module envelop_assembly( envelop=
false )
1905 if ( envelop ==
true )
1911 construct_exterior_walls(
true );
1912 construct_lips(
true );
1925 module assembly_add()
1929 construct_exterior_walls();
1948 envelop_assembly( mode_int_mask ==
true )
1954 envelop_assembly( mode_int_mask ==
true )
1955 construct_interior_walls();
1960 envelop_assembly( mode_int_mask ==
true )
1961 construct_posts( add=true );
1972 module assembly_remove()
1976 construct_posts( remove=
true );
2007 vrm_ci = (mode_lmt_vrm ==
false) ? vrm
2009 [
for (e=vrm)
select_ci(v=[0, 5, 1], i=e, l=
false)]
2010 :
select_ci(v=[0, 5, 1], i=vrm, l=
false);
2021 wall_h = (mode_size_in ==
true) ? h_h - lip_h : h_h - lip_h - lid_h;
2029 encl_x = (mode_size_in ==
true) ? size_x + 2*wth - wall_ox : size_x;
2030 encl_y = (mode_size_in ==
true) ? size_y + 2*wth - wall_oy : size_y;
2031 encl_z = (mode_size_in ==
true) ? wall_h + lip_h + lid_h : h_h;
2034 wall_xy = [encl_x + wall_ox, encl_y + wall_oy];
2037 szint_x =
first (wall_xy) - 2*wth;
2038 szint_y =
second(wall_xy) - 2*wth;
2039 szint_z = wall_h + lip_h;
2043 echo(
strl([
"box: construction begin"]));
2045 echo(
strl([
"box: exterior dimensions [x, y, z] = ", [encl_x, encl_y, encl_z]]));
2046 echo(
strl([
"box: interior dimensions [x, y, z] = ", [szint_x, szint_y, szint_z]]));
2057 [0, -encl_x, -szint_x -wth*2, -szint_x, +szint_x, +szint_x +wth*2, +encl_x ]/2,
2058 [0, -encl_y, -szint_y -wth*2, -szint_y, +szint_y, +szint_y +wth*2, +encl_y ]/2,
2059 [lid_h, 0, lid_h -encl_z/2, -wall_h/2, -wall_h, -wall_h -lip_h]
2066 translate([align_x, align_y, align_z])
2075 echo(
strl([
"box: alignment [x, y, z] = ", [align_x, align_y, align_z]]));
2077 echo(
strl([
"box: construction end"]));
2126 wall_h = (mode_size_in ==
true) ? h_h - lip_h : h_h - lip_h - lid_h,
2132 encl_x = (mode_size_in ==
true) ? size_x + 2*wth - wall_ox : size_x,
2133 encl_y = (mode_size_in ==
true) ? size_y + 2*wth - wall_oy : size_y,
2134 encl_z = (mode_size_in ==
true) ? wall_h + lip_h + lid_h : h_h,
2136 wall_xy = [encl_x + wall_ox, encl_y + wall_oy],
2138 szint_x =
first (wall_xy) - 2*wth,
2139 szint_y =
second(wall_xy) - 2*wth,
2140 szint_z = wall_h + lip_h
2142 bbox ? [szint_x, szint_y, szint_z] : [encl_x, encl_y, encl_z];
zero3d
<decimal-list-2> A 3d zero vector (a list with three zeros).
eps
<decimal> Epsilon, small distance to deal with overlapping shapes.
empty_lst
<list> A list with no values (the empty list).
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_ei_or(v, i, d, n)
Returns an element from an iterable if it exists and is a iterable, otherwise returns a default value...
function defined_e_or(v, i, d)
Returns an element from an iterable if it exists, or a default value if not.
function third(v)
Return the third element of an iterable value.
function last(v)
Return the last element of an iterable value.
function second(v)
Return the second element of an iterable value.
function defined_eon_or(v, i, d)
Returns the list element or scalar numeric value if defined, otherwise returns the default value.
function first(v)
Return the first element of an iterable value.
function shift_cd(v, n=0, r=true, d=false)
Circularly shift the elements of an iterable, with an optional element drop.
function tailn(v, n=1)
Return a list containing all but the first n elements 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 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 merge_s(v, r=false)
Serially merge the elements of a list.
function sum(v, i1, i2)
Compute the sum of a list of numbers.
function defined_or(v, d)
Return given value, if defined, or a secondary value, if primary is not defined.
function is_scalar(v)
Test if a value is a single non-iterable value.
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=0)
Return facets number for the given arc radius.
module project_box_rectangle(wth, h, size, vr, vrm, inset, lid, lip, rib, wall, post, hole, shape, align, mode=0, verb=0)
A rectangular box maker for project boxes, enclosures and housings.
function project_box_rectangle_size(wth, h, size, inset, lid, lip, mode=0, bbox=0)
Get the bounding box dimensions for a specified project box.
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.
module select_common_2d_shape(type=0, argv, center=false, verb=0)
Select configure and construct one of the available 2d shapes.
module select_common_3d_shape(type=0, argv, center=false, verb=0)
Select configure and construct one of the available 3d shapes.