65 [
"h_connector_max", 11.25],
66 [
"l_keya_2_bkto", 59.05],
67 [
"w_bkt_width", 18.42],
69 [
"h_rbpcbt_2_fngrb", 3.40],
73 [
"l_card_max_full", 312.00],
74 [
"l_card_max_half", 167.65],
83 [
"h_card_max", 111.15],
84 [
"h_card_max_2_pciblck", 106.65],
85 [
"h_pciblck_2_bktb", 100.36],
86 [
"h_bktb_2_bkttabb", 120.02],
88 [
"wh_copen_window", [12.06, 89.90]],
89 [
"h_bktb_2_copen", 10.16],
90 [
"w_pcb_2_copen", 0.35],
91 [
"wl_mnt_tab", [+21.59 - 2.54, 11.43]],
92 [
"w_mnt_tab_o", -1.57/2 + 18.42 - 21.59],
93 [
"wl_mnt_hole_o", [-1.57/2 - 1.27, -64.13]],
102 [
"h_card_max", 68.90],
103 [
"h_card_max_2_pciblck", 64.40],
104 [
"h_pciblck_2_bktb", 63.58],
105 [
"h_bktb_2_bkttabb", 79.20],
106 [
"w_bkt_tab", 10.19],
107 [
"wh_copen_window", [12.07, 54.53 + 5.08*2]],
108 [
"h_bktb_2_copen", 9.04 - 5.08],
109 [
"w_pcb_2_copen", 0.37],
110 [
"wl_mnt_tab", [18.59, 11.84]],
111 [
"w_mnt_tab_o", +1.57/2 + 0.37],
112 [
"wl_mnt_hole_o", [+1.57/2 + 14.71, -65.40]],
124 [
"bottom_clearance",
"Vertical clearance under riser board"],
125 [
"slot_count",
"Riser physical slot count (fixed)"],
126 [
"vslot_count",
"Riser virtual slot count (user adjustable)"],
127 [
"multi_slot_offset",
"PCI-E multi-slot, slot-to-slot spacing"],
128 [
"slot1_to_edge1",
"Riser board slot-1 to adjacent edge distance"],
129 [
"slotn_to_edgen",
"Riser board slot-n to adjacent edge distance"],
130 [
"slot_key_to_edgef",
"Riser board key to front edge distance"],
131 [
"slot_link_width",
"Slot connector link width {1|4|8|16}"],
132 [
"pcb_length",
"Riser board PCB length front to rear"],
133 [
"pcb_th",
"Riser board PCB thickness"],
134 [
"mount_holes",
"Riser board mount holes; referenced to slot-1 key"],
135 [
"mount_holes_add",
"Riser board mount holes additions"],
136 [
"post_rotate",
"Mount post rotation in degrees"],
137 [
"post_fins",
"Mount post fin configuration: see project_box_rectangle()"],
138 [
"post_hole_d",
"Mount post hole diameter"],
139 [
"post_pad_d",
"Mount post diameter"]
163 [
"bottom_clearance", 3],
166 [
"multi_slot_offset", 20.32],
167 [
"slot1_to_edge1", 15],
168 [
"slotn_to_edgen", 28],
169 [
"slot_key_to_edgef", 113.25],
170 [
"slot_link_width", 16],
171 [
"pcb_length", 127.75],
178 ko = [-11.50, -11.00]
187 [
"mount_holes_add", undef],
190 [
"post_hole_d", 3.00],
191 [
"post_pad_d", 2.75 * 3.00]
213 [
"bottom_clearance", 3],
216 [
"multi_slot_offset", 20.32],
217 [
"slot1_to_edge1", 12],
218 [
"slotn_to_edgen", 12],
219 [
"slot_key_to_edgef", 74],
220 [
"slot_link_width", 1],
240 [
"mount_holes_add", undef],
243 [
"post_hole_d", 3.00],
244 [
"post_pad_d", 2.75 * 3.00]
266 [
"bottom_clearance", 0],
269 [
"multi_slot_offset", 20.32],
270 [
"slot1_to_edge1", 5.75],
271 [
"slotn_to_edgen", 37.00],
272 [
"slot_key_to_edgef", 89.50],
273 [
"slot_link_width", 16],
274 [
"pcb_length", 122.00],
290 [
"mount_holes_add", undef],
293 [
"post_hole_d", 2.75],
294 [
"post_pad_d", 2.75 * 2.75]
306 [
"rounding",
"Enclosure corner rounding radius"],
307 [
"wth",
"Enclosure minimum wall thickness"],
308 [
"board_count",
"Enclosure riser board count"],
309 [
"multi_board_offset",
"Multi-riser inter board offset"],
310 [
"space_add_edge1",
"Space to add to riser edge-1"],
311 [
"space_add_edgen",
"Space to add to riser edge-n"],
312 [
"space_add_length",
"Space to add to riser end length"],
313 [
"space_add_height",
"Space to add to enclosure height"],
314 [
"space_min_length",
"Enclosure minimum interior length"],
315 [
"space_min_height",
"Enclosure minimum interior height"],
316 [
"rb_min_clearance",
"Riser board minimum bottom clearance"],
317 [
"rib_pcb_gap",
"Rib removal gap for PCIE and riser board PCB"],
318 [
"lips_sides",
"Sides lips specification: see project_box_rectangle()"],
319 [
"lips_base",
"Base lips specification: see project_box_rectangle()"],
320 [
"lips_cover",
"Cover lips specification: see project_box_rectangle()"],
321 [
"walls",
"Enclosure interior walls: see project_box_rectangle()"],
322 [
"ribs",
"Enclosure wall rib specification: see project_box_rectangle()"],
323 [
"posts_sides_conf",
"Post configuration sides: [mode, default]: see project_box_rectangle()"],
324 [
"posts_base_conf",
"Post configuration base: [mode, default]: see project_box_rectangle()"],
325 [
"posts_cover_conf",
"Post configuration cover: [mode, default]: see project_box_rectangle()"],
326 [
"posts_sides",
"Post instances sides only: see project_box_rectangle()"],
327 [
"posts_base",
"Post instances base only: see project_box_rectangle()"],
328 [
"posts_cover",
"Post instances cover only: see project_box_rectangle()"],
329 [
"posts",
"Post instances for sides, base and cover: see project_box_rectangle()"],
330 [
"clamps_base",
"Enclosure base clamps: see clamp_zt_1p()"],
331 [
"holes_sides",
"Enclosure side hole instances: see project_box_rectangle()"],
332 [
"holes_base",
"Enclosure base hole instances: see project_box_rectangle()"],
333 [
"holes_cover",
"Enclosure cover hole instances: see project_box_rectangle()"],
334 [
"shapes_sides",
"Enclosure side shapes instances: see project_box_rectangle()"],
335 [
"shapes_base",
"Enclosure base shapes instances: see project_box_rectangle()"],
336 [
"shapes_cover",
"Enclosure cover shapes instances: see project_box_rectangle()"],
337 [
"bracket_window_gap",
"Bracket connector window gap [w]"],
338 [
"bracket_shoe_gap_p",
"Bracket shoe gap% [w, l, h]"],
339 [
"bracket_shoe_offset",
"Bracket shoe vertical offset [h]"],
340 [
"bracket_mount_tab",
"Bracket mount tab configuration"],
341 [
"cut_sides",
"Enclosure sides cut [insets, vr, vrm]"],
342 [
"mode_rounding",
"Enclosure rounding mode: {0|1|2}"],
343 [
"mode_sides",
"Enclosure sides mode"],
344 [
"mode_proj_box",
"Mode for project_box_rectangle() module"],
345 [
"verb_proj_box",
"Verbosity for project_box_rectangle()"]
461 [
"multi_board_offset", 0],
463 [
"space_add_edge1", 0],
464 [
"space_add_edgen", 0],
465 [
"space_add_length", 0],
466 [
"space_add_height", 0],
468 [
"space_min_length", 0],
469 [
"space_min_height", 0],
471 [
"rb_min_clearance", 0],
473 [
"rib_pcb_gap", 1/2],
475 [
"lips_sides", 1 + 8],
531 let(u=undef, t=2, o=7.5, f=[4, 120, u, 1/6])
533 [t, [-1,-1], [+o,+o], 180, u, u, u, f],
534 [t, [-1,+1], [+o,-o], 090, u, u, u, f],
535 [t, [+1,-1], [-o,+o], 270, u, u, u, f],
536 [t, [+1,+1], [-o,-o], 000, u, u, u, f]
540 let(u=undef, t=3, o=7.5, f=[2, 180, u, 1/6])
542 [t, [-1,-1], [+o,+o], 000, u, u, u, f],
543 [t, [-1,+1], [+o,-o], 270, u, u, u, f],
544 [t, [+1,-1], [-o,+o], 090, u, u, u, f],
545 [t, [+1,+1], [-o,-o], 180, u, u, u, f]
549 let(u=undef, t=3, o=7.5, f=[2, 180, u, 1/6])
551 [t, [-1,-1], [+o,+o], 000, u, u, u, f],
552 [t, [-1,+1], [+o,-o], 270, u, u, u, f],
553 [t, [+1,-1], [-o,+o], 090, u, u, u, f],
554 [t, [+1,+1], [-o,-o], 180, u, u, u, f]
648 [
"bracket_window_gap", 2.00],
649 [
"bracket_shoe_gap_p", 25/100],
650 [
"bracket_shoe_offset", -2.00],
651 [
"bracket_mount_tab",
658 [5.0, 6.0, 2.0, 3/4, 1/4]
670 [
"mode_rounding", 2],
672 [
"mode_proj_box", 0],
719 rb_vslot_count = is_undef( vslots ) ?
725 rb_slot1_to_edge1 =
map_get_value(riser_pcb,
"slot1_to_edge1"),
726 rb_slotn_to_edgen =
map_get_value(riser_pcb,
"slotn_to_edgen"),
727 rb_multi_slot_offset =
map_get_value(riser_pcb,
"multi_slot_offset"),
728 rb_slot_key_to_edgef =
map_get_value(riser_pcb,
"slot_key_to_edgef"),
732 w = rb_slot1_to_edge1
733 + (rb_slot_count + max(0, rb_vslot_count) - 1) * rb_multi_slot_offset
769 riser_width = is_undef( riser_pcb_width ) ?
774 pcie_spec =
map_merge(pcie_form, pcie_base),
776 pcie_l_keya_2_bkto =
map_get_value(pcie_spec,
"l_keya_2_bkto"),
778 pcie_h_rbpcbt_2_fngrb =
map_get_value(pcie_spec,
"h_rbpcbt_2_fngrb"),
781 rb_bottom_clearance =
map_get_value(riser_pcb,
"bottom_clearance"),
783 rb_slot_key_to_edgef =
map_get_value(riser_pcb,
"slot_key_to_edgef"),
788 encl_multi_board_offset =
map_get_value(enclosure,
"multi_board_offset"),
789 encl_space_add_edge1 =
map_get_value(enclosure,
"space_add_edge1"),
790 encl_space_add_edgen =
map_get_value(enclosure,
"space_add_edgen"),
791 encl_space_add_length =
map_get_value(enclosure,
"space_add_length"),
792 encl_space_add_height =
map_get_value(enclosure,
"space_add_height"),
793 encl_space_min_length =
map_get_value(enclosure,
"space_min_length"),
794 encl_space_min_height =
map_get_value(enclosure,
"space_min_height"),
796 encl_rb_min_clearance =
map_get_value(enclosure,
"rb_min_clearance"),
799 rb_mount_post_height = encl_wth
800 + max(rb_bottom_clearance, encl_rb_min_clearance),
803 + (encl_board_count-1) * (riser_width + encl_multi_board_offset)
804 + encl_space_add_edge1
805 + encl_space_add_edgen,
807 l = rb_slot_key_to_edgef
809 + encl_space_add_length,
811 h = rb_mount_post_height
813 + pcie_h_rbpcbt_2_fngrb
815 + encl_space_add_height,
817 l_min = max(l, encl_space_min_length),
818 h_min = max(h, encl_space_min_height)
820 ( external ) ? [ w, l_min, h_min ] + [ encl_wth*2, encl_wth*2, encl_wth*2 ]
821 : [ w, l_min, h_min ];
868 riser_width = is_undef( riser_pcb_width ) ?
872 encl_size_wlh = is_undef( enclosure_size ) ?
885 pcie_spec =
map_merge(pcie_form, pcie_base),
887 pcie_l_keya_2_bkto =
map_get_value(pcie_spec,
"l_keya_2_bkto"),
892 rb_multi_slot_offset =
map_get_value(riser_pcb,
"multi_slot_offset"),
893 rb_slot1_to_edge1 =
map_get_value(riser_pcb,
"slot1_to_edge1"),
894 rb_bottom_clearance =
map_get_value(riser_pcb,
"bottom_clearance"),
899 encl_multi_board_offset =
map_get_value(enclosure,
"multi_board_offset"),
900 encl_space_add_edge1 =
map_get_value(enclosure,
"space_add_edge1"),
902 encl_rb_min_clearance =
map_get_value(enclosure,
"rb_min_clearance"),
905 rb_mount_post_height = encl_wth
906 + max(rb_bottom_clearance, encl_rb_min_clearance),
908 w_zero = + encl_space_add_edge1
909 + ( edge1_w ? 0 : rb_slot1_to_edge1 )
910 - ( ! center_w ? 0 :
first(encl_size_wlh)/2 ),
912 l_zero = zero_lh ? 0 : -
second(encl_size_wlh)/2 + pcie_l_keya_2_bkto,
913 h_zero = zero_lh ? 0 : + encl_wth + rb_mount_post_height,
915 h_zadj = adjust_h ? -encl_wth*2 : 0
918 for (rb_n = [0:encl_board_count-1])
920 for (rb_s = [0 : rb_slot_count + max(0, rb_vslot_count) - 1])
923 w_oi = rb_n * (riser_width + encl_multi_board_offset),
924 w_os = rb_s * rb_multi_slot_offset
926 [w_zero + w_oi + w_os, l_zero, h_zero + h_zadj]
1044 module enclosure_base(enable = 1+2)
1049 encl_bracket_shoe_offset =
map_get_value(enclosure,
"bracket_shoe_offset");
1055 encl_bracket_shoe_gap_p =
map_get_value(enclosure,
"bracket_shoe_gap_p");
1058 module wire_clamps(mode)
1060 for (clamp_sets = encl_clamps_base)
1062 clamp_conf =
first(clamp_sets);
1063 clamp_inst =
second(clamp_sets);
1065 for (inst = clamp_inst)
1080 rotate([90, 0, eci_rotate])
1083 size = clamp_conf[0],
1084 ztie = clamp_conf[1],
1085 clamp = clamp_conf[2],
1086 tunnel = clamp_conf[3],
1088 vrm = clamp_conf[5],
1090 align = [0, 1, eci_align],
1098 module model_riser()
1102 rb_slot1_to_edge1 =
map_get_value(riser_pcb,
"slot1_to_edge1");
1103 rb_slot_key_to_edgef =
map_get_value(riser_pcb,
"slot_key_to_edgef");
1105 rb_slot_link_width =
map_get_value(riser_pcb,
"slot_link_width");
1111 sm = [ [1, 25], [4, 39], [8, 56], [16, 89] ];
1118 ro = [-rb_slot1_to_edge1, -riser_size0.y + rb_slot_key_to_edgef, 0];
1119 so = [-ss.x/2, -ko, rb_pcb_th];
1121 for (wlh_rb_inst = slot_keys_wlh)
1126 wlh_rb_inst_o =
first( wlh_rb_inst );
1128 translate(wlh_rb_inst_o + ro)
1129 cube(riser_size0, center=
false);
1131 for (p = rb_mount_holes)
1132 translate(wlh_rb_inst_o + concat(p, -
eps*2))
1133 cylinder(d=rb_post_hole_d, h=rb_pcb_th+
eps*4, center=
false);
1137 for (i = [0 : rb_slot_count-1])
1139 wlh_slot_inst = wlh_rb_inst[i];
1141 translate(wlh_slot_inst + so)
1142 cube(ss, center=
false);
1148 rb_mount_post_insts =
1152 rb_mount_holes_add =
map_get_value(riser_pcb,
"mount_holes_add"),
1159 insts = is_undef(rb_mount_holes_add) ?
1161 : concat(rb_mount_holes, rb_mount_holes_add)
1164 for (rb_s = slot_keys_wlh, pm_inst = insts)
1167 rb_s1 =
first(rb_s),
1169 post_h =
third(rb_s1) - encl_wth
1177 [rb_post_hole_d, post_h],
1178 [rb_post_pad_d, post_h],
1184 encl_posts_base_all =
1185 merge_post_inst_sets
1187 encl_posts_base_conf,
1188 [ encl_posts_base, rb_mount_post_insts ],
1195 -pcie_w_pcb_mth/2 - pcie_bkt_mth + pcie_w_bkt_tabo,
1197 -pcie_l_keya_2_bkto,
1200 + ( pcie_h_card_max - pcie_h_card_max_2_pciblck )
1201 + pcie_h_rbpcbt_2_fngrb
1202 + pcie_h_pciblck_2_bktb
1203 - pcie_h_bktb_2_bkttabb
1213 tab_sm = 1 + encl_bracket_shoe_gap_p;
1214 tab_ho = encl_bracket_shoe_offset;
1216 tab_so = pcie_w_bkt_width * (1 - tab_sm)/4;
1218 tab_bw = pcie_w_bkt_width * tab_sm;
1219 tab_tw = pcie_w_bkt_tab * tab_sm;
1220 tab_tl = pcie_bkt_mth * tab_sm;
1221 tab_th = pcie_h_bkt_tab * tab_sm;
1230 size =
firstn(encl_size_wlh, 2),
1233 lip = encl_lips_base,
1236 post = encl_posts_base_all,
1237 hole = encl_holes_base,
1238 shape = encl_shapes_base,
1240 vrm = encl_mode_rounding,
1242 mode =
binary_or(encl_mode_proj_box, 1),
1243 verb = encl_verb_proj_box
1247 for (wlh_rb_inst = slot_keys_wlh)
1248 for (wlh_slot_inst = wlh_rb_inst)
1251 so = wlh_slot_inst + wlh_rb1s1_bwo + [tab_so - encl_wth, 0, 0],
1253 sh = max(encl_wth*2,
third(so) + encl_wth),
1257 translate(
firstn(so, 2) )
1259 pg_rectangle([tab_tw+encl_wth*2, tab_tl + encl_wth], vrm=vrm, vr=vr);
1263 for (wlh_rb_inst = slot_keys_wlh)
1264 for (wlh_slot_inst = wlh_rb_inst)
1265 translate(wlh_slot_inst + wlh_rb1s1_bwo)
1267 translate([tab_so, tab_ho, -tab_tl])
1271 pg_trapezoid(b=[tab_tw, tab_bw], h=tab_th, a=117.125, o=[0, tab_th]);
1284 if ( show_riser ==
true )
1291 module enclosure_sides(enable = 1+2+4+8)
1318 rb_slot1_to_edge1 =
map_get_value(riser_pcb,
"slot1_to_edge1");
1325 encl_shapes_sides =
map_get_value(enclosure,
"shapes_sides");
1326 encl_bracket_mount_tab =
map_get_value(enclosure,
"bracket_mount_tab");
1330 encl_bracket_window_gap =
map_get_value(enclosure,
"bracket_window_gap");
1333 module wire_clamps_passage( mode )
1335 for (clamp_sets = encl_clamps_base)
1337 clamp_conf =
first(clamp_sets);
1338 clamp_inst =
second(clamp_sets);
1340 for (inst = clamp_inst)
1352 wire = clamp_conf[0];
1363 rotate([90, 0, eci_rotate])
1366 size = wire + [0, pass_hcut],
1377 module bracket_mount_tab_shelf
1385 function zz_oy ( p ) = inplace ? p : [p.x, p.y - encl_wth*3, -encl_wth + wth];
1387 wth =
defined_e_or(encl_bracket_mount_tab, 0, encl_wth);
1394 for (wlh_rb_inst = slot_keys_wlh)
1399 for (wlh_slot_inst = wlh_rb_inst)
1400 translate( zz_oy (wlh_slot_inst + wlh_rb1s1_bwo) )
1402 w_o = -wa + pcie_w_mnt_tab_o;
1406 translate([w_o, l_o, h_o])
1409 pg_rectangle(size=pcie_wl_mnt_tab + [2,0]*wa, vr=vr, vrm=vrm, center=
false);
1413 for (wlh_slot_inst = wlh_rb_inst)
1414 translate( zz_oy (wlh_slot_inst + wlh_rb1s1_bwo) )
1417 l_o = +pcie_l_keya_2_bkto;
1420 translate([w_o, l_o, h_o] + concat(pcie_wl_mnt_hole_o, 0))
1421 cylinder(d=hd, h=wth+
eps*4, center=
true);
1426 for (wlh_rb_inst = slot_keys_wlh, wlh_slot_inst = wlh_rb_inst)
1427 translate( zz_oy (wlh_slot_inst + wlh_rb1s1_bwo) )
1430 w =
first( pcie_wl_mnt_tab );
1431 d = encl_wth +
eps*4;
1433 w_o = pcie_w_mnt_tab_o;
1437 translate([w_o, l_o, h_o])
1444 module cut_enclosure_sides( cut_sides )
1448 + [2, 2, 1] * encl_wth
1463 [+(es.y/2 - fbo), 0],
1464 [-(es.y/2 - bbo), 0],
1465 [-(es.y/2 - bto), es.z],
1466 [+(es.y/2 - fto), es.z],
1472 translate([0, 0, -encl_wth])
1488 encl_posts_sides_all =
1489 merge_post_inst_sets
1491 encl_posts_sides_conf,
1492 [ encl_posts_sides ],
1497 wlh_s2b_ao = [ 0, 0, encl_wth*2 ];
1504 -pcie_l_keya_2_bkto,
1507 + ( pcie_h_card_max - pcie_h_card_max_2_pciblck )
1508 + pcie_h_rbpcbt_2_fngrb
1509 + pcie_h_pciblck_2_bktb
1516 masked_ribs =
binary_or(decode_ribs, 1);
1519 encode_ribs = is_list(encl_ribs) ?
1520 concat(masked_ribs,
tailn(encl_ribs))
1535 size =
firstn(encl_size_wlh, 2),
1537 h =
third(encl_size_wlh),
1538 lip = encl_lips_sides,
1541 post = encl_posts_sides_all,
1542 hole = encl_holes_sides,
1543 shape = encl_shapes_sides,
1545 vrm = encl_mode_rounding,
1547 mode =
binary_or(encl_mode_proj_box, 1),
1548 verb = encl_verb_proj_box
1553 translate(wlh_s2b_ao)
1554 wire_clamps_passage(1);
1558 bracket_mount_tab_shelf(inplace=
true, dovetail=
false);
1562 rib_h = encl_wth * 2;
1565 gap_w = encl_bracket_window_gap;
1568 for (wlh_rb_inst = slot_keys_wlh)
1572 for (wlh_slot_inst = wlh_rb_inst)
1573 translate(wlh_slot_inst + wlh_rb1s1_bwo)
1575 w = pcie_wh_copen_window;
1576 e = encl_wth + rib_h;
1578 t = [ pcie_w_pcb_mth/2 + pcie_w_pcb_2_copen,
1580 -pcie_h_bktb_2_copen ];
1582 translate( t - [gap_w/2, 0, 0] ) rotate( r )
1589 for (wlh_slot_inst = wlh_rb_inst)
1590 translate(wlh_slot_inst + wlh_rb1s1_bwo)
1592 w = [pcie_w_bkt_width, pcie_h_bktb_2_bkttabb];
1595 t = [ -pcie_w_pcb_mth/2 - pcie_bkt_mth, 0, 0 ];
1597 translate( t - [gap_w/2, 0, 0] ) rotate( r )
1604 for (wlh_slot_inst = wlh_rb_inst)
1605 translate(wlh_slot_inst + wlh_rb1s1_bwo)
1607 w = pcie_wl_mnt_tab + [0, rib_h];
1608 e = pcie_h_connector_max - pcie_h_rbpcbt_2_fngrb + pcie_bkt_mth;
1610 t = [ pcie_w_mnt_tab_o, -
second(pcie_wl_mnt_tab), 0 ];
1612 translate( t - [gap_w/2, 0, 0] ) rotate( r )
1621 wlh_rbs1 =
first( wlh_rb_inst );
1626 wlh_rbs1.x - rb_slot1_to_edge1,
1631 g = [encl_rib_pcb_gap, encl_rib_pcb_gap];
1633 translate( wlh_rb1s1_fwo )
1635 w = [riser_size0.x, riser_size0.z] + g;
1638 t = [ -g.x/2,
eps*4, -g.y/2-rib_h ];
1640 translate( t ) rotate( r )
1649 for (wlh_slot_inst = wlh_rb_inst)
1659 g = [encl_rib_pcb_gap, 0];
1661 translate( wlh_rb1s1_fwo )
1663 w = [pcie_w_pcb_mth, encl_size_wlh.z] + g;
1666 t = [ -g.x/2 - pcie_w_pcb_mth/2,
eps*4, -g.y/2-rib_h ];
1668 translate( t ) rotate( r )
1678 translate(wlh_s2b_ao)
1679 wire_clamps_passage(0);
1683 cut_enclosure_sides( encl_cut_sides );
1687 bracket_mount_tab_shelf(inplace=true, dovetail=true, dovetail_type=2);
1694 bracket_mount_tab_shelf(inplace=false, dovetail=true, dovetail_type=0);
1700 module enclosure_cover(enable = 1)
1706 encl_shapes_cover =
map_get_value(enclosure,
"shapes_cover");
1709 encl_posts_cover_all =
1710 merge_post_inst_sets
1712 encl_posts_cover_conf,
1713 [ encl_posts_cover ],
1725 size =
firstn(encl_size_wlh, 2),
1728 lip = encl_lips_cover,
1731 post = encl_posts_cover_all,
1732 hole = encl_holes_cover,
1733 shape = encl_shapes_cover,
1735 vrm = encl_mode_rounding,
1737 mode =
binary_or(encl_mode_proj_box, 1),
1738 verb = encl_verb_proj_box
1745 module dovetail_test(select = 0)
1747 encl_bracket_mount_tab =
map_get_value(enclosure,
"bracket_mount_tab");
1749 wth =
defined_e_or(encl_bracket_mount_tab, 0, encl_wth);
1752 w =
first( pcie_wl_mnt_tab );
1753 d = encl_wth +
eps*4;
1761 translate([-x/2, +
eps*2, -wth/2-
eps*2])
1762 cube([w+x, d-
eps*4, wth*3/2], center=
false);
1771 translate([-x/2, -d, 0])
1772 cube([w+x, d, wth], center=false);
1780 translate([0, wth + d*2, 0])
1784 translate([-x/2, +
eps*2, -wth/2-
eps*2])
1785 cube([w+x, d-
eps*4, wth*3/2], center=
false);
1791 translate([0, 0, +wth/2])
1794 translate([-x/2, +
eps*2, -wth/2-
eps*2])
1795 cube([w+x, d-
eps*4, wth*3/2], center=
false);
1801 translate([0, -d*2, 0])
1806 translate([-x/2, -d, 0])
1807 cube([w+x, d, wth], center=false);
1815 function merge_post_inst_sets
1818 local_instance_sets,
1820 global_instance_sets
1826 for (set = local_instance_sets)
1827 for (instance = set)
1831 for (set = global_instance_sets)
1832 for (instance = set)
1835 type =
first(instance),
1836 inst =
tailn(instance)
1838 concat(type + global_type_append, inst)
1847 pcie_spec =
map_merge(pcie_form, pcie_base);
1849 pcie_h_connector_max =
map_get_value(pcie_spec, "h_connector_max");
1850 pcie_l_keya_2_bkto =
map_get_value(pcie_spec, "l_keya_2_bkto");
1853 pcie_h_rbpcbt_2_fngrb =
map_get_value(pcie_spec, "h_rbpcbt_2_fngrb");
1856 pcie_h_card_max_2_pciblck =
map_get_value(pcie_spec, "h_card_max_2_pciblck");
1857 pcie_h_pciblck_2_bktb =
map_get_value(pcie_spec, "h_pciblck_2_bktb");
1858 pcie_h_bktb_2_bkttabb =
map_get_value(pcie_spec, "h_bktb_2_bkttabb");
1862 pcie_wh_copen_window =
map_get_value(pcie_spec, "wh_copen_window");
1863 pcie_h_bktb_2_copen =
map_get_value(pcie_spec, "h_bktb_2_copen");
1864 pcie_w_pcb_2_copen =
map_get_value(pcie_spec, "w_pcb_2_copen");
1867 pcie_wl_mnt_hole_o =
map_get_value(pcie_spec, "wl_mnt_hole_o");
1874 encl_mode_rounding =
map_get_value(enclosure, "mode_rounding");
1881 encl_mode_proj_box =
map_get_value(enclosure, "mode_proj_box");
1882 encl_verb_proj_box =
map_get_value(enclosure, "verb_proj_box");
1885 encl_posts_sides_conf =
map_get_value(enclosure, "posts_sides_conf");
1886 encl_posts_base_conf =
map_get_value(enclosure, "posts_base_conf");
1887 encl_posts_cover_conf =
map_get_value(enclosure, "posts_cover_conf");
1896 riser_width =
first( riser_size );
1932 encl_size_int = encl_size_wlh;
1944 echo(
strl([parent_module(0),
".size.exterior: [w, l, h] = ", encl_size_ext]));
1945 echo(
strl([parent_module(0),
".size.interior: [w, l, h] = ", encl_size_int]));
1949 rt_base_sides_cover =
1954 w =
first(encl_size_wlh),
1955 h =
third(encl_size_wlh),
1964 [nop, [0, 0, -t-h/2+e]],
1965 [nop, [0, 0, -s-t-h/2]],
1971 [nop, [0, 0, t-h/2]],
1972 [nop, [0, 0, t-h/2]],
1978 [nop, [0, 0, +t*2+h/2]],
1979 [nop, [0, 0, +s+t*2+h/2]],
1980 [[0, 180, 0], [b+w, 0, 0]]
1989 module construct_ctrl( bit, rt )
1999 construct_ctrl( 0, rt_base )
2003 construct_ctrl( 1, rt_sides )
2004 enclosure_sides(1+2+4+8);
2007 construct_ctrl( 2, rt_cover )
2011 construct_ctrl( 3, rt_sides )
2012 enclosure_sides(1+2+4+16);
2015 construct_ctrl( 4, rt_sides )
2016 enclosure_sides(32);
origin3d
<point-3d> The origin point coordinate in 3-dimensional Euclidean space.
zero3d
<decimal-list-2> A 3d zero vector (a list with three zeros).
eps
<decimal> Epsilon, small distance to deal with overlapping shapes.
function binary_ishl(v, s=1)
Base-2 binary left-shift operation for an integer.
function binary_bit_is(v, b, t=1)
Test if a binary bit position of an integer value equals a test bit.
function binary_or(v1, v2, _bv=1)
Base-2 binary OR operation for integers.
function firstn(v, n=1)
Return a list containing the first n elements of an iterable 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 second(v)
Return the second element of an iterable value.
function first(v)
Return the first element of an iterable value.
function tailn(v, n=1)
Return a list containing all but the first n elements of an iterable value.
function select_ci(v, i, l=true)
Select specified element from list or return a default.
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.
module map_check(m, verbose=false)
Perform basic format checks on a map and output errors to console.
function map_merge(m1, m2)
Merge the unique key-value pairs of a second map with those of a first.
function defined_or(v, d)
Return given value, if defined, or a secondary value, if primary is not 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 joint2d_dovetail(t=1, d=1, w=10, o=0, type=0, trim=false, center=false, align)
Create 2D edge profiles for dovetail joint construction.
riser_pcb_def
<map> Default riser board configuration.
pcie_expansion_debug
<boolean> Set to true to check configuration structure.
function pcie_expansion_rb_size(riser_pcb, vslots)
Get riser board size for riser configuration.
riser_PCE164P_NO3_VER_007
<map> USB 3.0 PCE164P-NO3 VER 007 1-slot riser board.
riser_SFF_8612_4X_to_PCI_E_16X
<map> SFF-8612 4X lane to 16X 1-slot riser board.
function pcie_expansion_size(pcie_base=pcie_spec_common, pcie_form=pcie_spec_half, riser_pcb=riser_pcb_def, enclosure=enclosure_def, riser_pcb_width, external=false)
Get enclosure internal or external size.
enclosure_def
<map> Default enclosure configuration.
module pcie_expansion(pcie_base=pcie_spec_common, pcie_form=pcie_spec_half, riser_pcb=riser_pcb_def, enclosure=enclosure_def, show_riser=false, part_color, part=7, mode=3, verb=0)
Generate a PCI Express expansion open chassis or closed enclosure.
pcie_expansion_debug_verbose
<boolean> Set to true for verbose configuration checking.
riser_AAAPCIE4HUB
<map> AAAPCIE4HUB multiplier HUB 4-slot riser board.
function pcie_expansion_rbs_keys(pcie_base=pcie_spec_common, pcie_form=pcie_spec_half, riser_pcb=riser_pcb_def, enclosure=enclosure_def, riser_pcb_width, enclosure_size, center_w=true, zero_lh=false, edge1_w=false, adjust_h=false)
Get list of slot key locations of all riser boards.
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.
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 cone(size=1, vr, center=false)
A cone.
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_rectangle(size=1, o, vr, vrm=1, vfn, center=false)
A polygon rectangle with vertex rounding.