From 319bbe516effb4456ba10bb177281cfb1e579871 Mon Sep 17 00:00:00 2001 From: Edward Kisiel Date: Sun, 26 May 2024 15:57:06 -0400 Subject: [PATCH] added multi-pcb indent support, new devices nodemcu-32s and cs-solarmeter --- SBC_Model_Framework | 2 +- mod/case_bottom.scad | 31 ++++++--- mod/case_side.scad | 30 +++++--- mod/case_top.scad | 30 +++++--- mod/indent.scad | 2 +- sbc_case_builder.json | 155 +++++++++++++++++++++++++++++++++++++++++- sbc_case_builder.scad | 2 +- 7 files changed, 217 insertions(+), 35 deletions(-) diff --git a/SBC_Model_Framework b/SBC_Model_Framework index 844bd63..15b092d 160000 --- a/SBC_Model_Framework +++ b/SBC_Model_Framework @@ -1 +1 @@ -Subproject commit 844bd63fd3f0a027e9ace1fc7d63194525e73aa9 +Subproject commit 15b092dd54013c65d9671055eeafa1bccf1b44f2 diff --git a/mod/case_bottom.scad b/mod/case_bottom.scad index 15b10c2..9471c84 100644 --- a/mod/case_bottom.scad +++ b/mod/case_bottom.scad @@ -713,20 +713,29 @@ echo(pcb_depth+case_offset_y-10); } // indents if(indents == true) { - for (i=[1:11:len(sbc_data[s[0]])-2]) { class = sbc_data[s[0]][i+1]; type = sbc_data[s[0]][i+2]; - id = sbc_data[s[0]][i+3]; - loc_x = sbc_data[s[0]][i+4]+pcb_loc_x; - loc_y = sbc_data[s[0]][i+5]+pcb_loc_y; - loc_z = sbc_data[s[0]][i+6]+pcb_loc_z; - side = sbc_data[s[0]][i+7]; - rotation = sbc_data[s[0]][i+8]; - -// indent(loc_x, loc_y, bottom_height+pcb_loc_z-adj, rotation[2], side, class, type, wallthick, gap, floorthick, pcb_z); - indent(loc_x, loc_y, bottom_height+pcb_loc_z-adj, rotation[2], side, class, type, wallthick, gap, floorthick, pcb_z); - } + pcbid = sbc_data[s[0]][i+3]; + pcbloc_x = sbc_data[s[0]][i+4]; + pcbloc_y = sbc_data[s[0]][i+5]; + pcbloc_z = sbc_data[s[0]][i+6]; + if(class == "pcb") { + for (i=[1:11:len(sbc_data[s[0]])-2]) { + class = sbc_data[s[0]][i+1]; + type = sbc_data[s[0]][i+2]; + id = sbc_data[s[0]][i+3]; + loc_x = sbc_data[s[0]][i+4]+pcb_loc_x+pcbloc_x; + loc_y = sbc_data[s[0]][i+5]+pcb_loc_y+pcbloc_y; + loc_z = sbc_data[s[0]][i+6]+pcb_loc_z+pcbloc_z; + side = sbc_data[s[0]][i+7]; + rotation = sbc_data[s[0]][i+8]; + if(id == pcbid) { + indent(loc_x, loc_y, bottom_height+loc_z-adj, rotation[2], side, class, type, wallthick, gap, floorthick, pcb_z); + } + } + } + } } // clean fillets if(case_design == "shell") { diff --git a/mod/case_side.scad b/mod/case_side.scad index 71f83b4..71256cf 100644 --- a/mod/case_side.scad +++ b/mod/case_side.scad @@ -266,19 +266,29 @@ module case_side(case_design, side) { } // indents if(indents == true) { - for (i=[1:11:len(sbc_data[s[0]])-2]) { class = sbc_data[s[0]][i+1]; type = sbc_data[s[0]][i+2]; - id = sbc_data[s[0]][i+3]; - loc_x = sbc_data[s[0]][i+4]+pcb_loc_x; - loc_y = sbc_data[s[0]][i+5]+pcb_loc_y; - loc_z = sbc_data[s[0]][i+6]+pcb_loc_z; - side = sbc_data[s[0]][i+7]; - rotation = sbc_data[s[0]][i+8]; - - indent(loc_x, loc_y, bottom_height+pcb_loc_z-adj, rotation[2], side, class, type, wallthick, gap, floorthick, pcb_z); - } + pcbid = sbc_data[s[0]][i+3]; + pcbloc_x = sbc_data[s[0]][i+4]; + pcbloc_y = sbc_data[s[0]][i+5]; + pcbloc_z = sbc_data[s[0]][i+6]; + if(class == "pcb") { + for (i=[1:11:len(sbc_data[s[0]])-2]) { + class = sbc_data[s[0]][i+1]; + type = sbc_data[s[0]][i+2]; + id = sbc_data[s[0]][i+3]; + loc_x = sbc_data[s[0]][i+4]+pcb_loc_x+pcbloc_x; + loc_y = sbc_data[s[0]][i+5]+pcb_loc_y+pcbloc_y; + loc_z = sbc_data[s[0]][i+6]+pcb_loc_z+pcbloc_z; + side = sbc_data[s[0]][i+7]; + rotation = sbc_data[s[0]][i+8]; + if(id == pcbid) { + indent(loc_x, loc_y, bottom_height+loc_z-adj, rotation[2], side, class, type, wallthick, gap, floorthick, pcb_z); + } + } + } + } } } if(accessory_name != "none") { diff --git a/mod/case_top.scad b/mod/case_top.scad index 58e408a..c5d0363 100644 --- a/mod/case_top.scad +++ b/mod/case_top.scad @@ -613,19 +613,29 @@ module case_top(case_design) { } // indents if(indents == true) { - for (i=[1:11:len(sbc_data[s[0]])-2]) { class = sbc_data[s[0]][i+1]; type = sbc_data[s[0]][i+2]; - id = sbc_data[s[0]][i+3]; - loc_x = sbc_data[s[0]][i+4]+pcb_loc_x; - loc_y = sbc_data[s[0]][i+5]+pcb_loc_y; - loc_z = sbc_data[s[0]][i+6]+pcb_loc_z; - side = sbc_data[s[0]][i+7]; - rotation = sbc_data[s[0]][i+8]; - - indent(loc_x, loc_y, bottom_height+pcb_loc_z-adj, rotation[2], side, class, type, wallthick, gap, floorthick, pcb_z); - } + pcbid = sbc_data[s[0]][i+3]; + pcbloc_x = sbc_data[s[0]][i+4]; + pcbloc_y = sbc_data[s[0]][i+5]; + pcbloc_z = sbc_data[s[0]][i+6]; + if(class == "pcb") { + for (i=[1:11:len(sbc_data[s[0]])-2]) { + class = sbc_data[s[0]][i+1]; + type = sbc_data[s[0]][i+2]; + id = sbc_data[s[0]][i+3]; + loc_x = sbc_data[s[0]][i+4]+pcb_loc_x+pcbloc_x; + loc_y = sbc_data[s[0]][i+5]+pcb_loc_y+pcbloc_y; + loc_z = sbc_data[s[0]][i+6]+pcb_loc_z+pcbloc_z; + side = sbc_data[s[0]][i+7]; + rotation = sbc_data[s[0]][i+8]; + if(id == pcbid) { + indent(loc_x, loc_y, bottom_height+loc_z-adj, rotation[2], side, class, type, wallthick, gap, floorthick, pcb_z); + } + } + } + } } // clean fillets if(case_design == "shell") { diff --git a/mod/indent.scad b/mod/indent.scad index f6978c6..b270c30 100644 --- a/mod/indent.scad +++ b/mod/indent.scad @@ -242,7 +242,7 @@ module indent(loc_x, loc_y, loc_z, rotation, side, class, type, wallthick, gap, rotate([90,0,0]) cylinder(d=10, h=wallthick); } if(class == "audio" && type == "jack_3.5" && rotation == 180 && side == "top") { - place(loc_x-4.6,depth-(wallthick+gap)-8-wallthick/2,loc_z+2,8,8,rotation,side) + place(loc_x-5.5,depth-(wallthick+gap)-8-wallthick/2,loc_z+2,8,8,rotation,side) rotate([90,0,0]) cylinder(d=10, h=wallthick); } if(class == "audio" && type == "jack_3.5" && rotation == 270 && side == "top") { diff --git a/sbc_case_builder.json b/sbc_case_builder.json index 2309699..9ca0366 100644 --- a/sbc_case_builder.json +++ b/sbc_case_builder.json @@ -4356,7 +4356,7 @@ "access_panel_rotation": "0", "access_panel_size": "[80, 75]", "accessory_highlight": "false", - "accessory_name": "rock5b", + "accessory_name": "none", "adj": "0.01", "bend_allowance": "1", "bottom_access_panel_enable": "true", @@ -6809,6 +6809,159 @@ "uart_opening": "default", "view": "model", "wallthick": "2" + }, + "cs-solar_energy_meter": { + "$fn": "90", + "access_panel_location": "[10, 15]", + "access_panel_orientation": "landscape", + "access_panel_rotation": "0", + "access_panel_size": "[70, 30]", + "accessory_highlight": "false", + "accessory_name": "none", + "adj": "0.01", + "bend_allowance": "1", + "bottom_access_panel_enable": "false", + "bottom_clearence": "3.5", + "bottom_cover_pattern": "solid", + "bottom_front_left_adjust": "0", + "bottom_front_left_enable": "true", + "bottom_front_left_support": "front", + "bottom_front_right_adjust": "0", + "bottom_front_right_enable": "true", + "bottom_front_right_support": "front", + "bottom_rear_left_adjust": "0", + "bottom_rear_left_enable": "true", + "bottom_rear_left_support": "rear", + "bottom_rear_right_adjust": "0", + "bottom_rear_right_enable": "true", + "bottom_rear_right_support": "rear", + "bottom_sidewall_support": "false", + "bottom_standoff_diameter": "5.75", + "bottom_standoff_hole_size": "3.4", + "bottom_standoff_insert": "false", + "bottom_standoff_insert_dia": "4.2", + "bottom_standoff_insert_height": "5.1", + "bottom_standoff_pillar": "hex", + "bottom_standoff_reverse": "false", + "bottom_standoff_size": "m3", + "bottom_standoff_support_height": "4", + "bottom_standoff_support_size": "10", + "bottom_standoff_type": "countersunk", + "case_design": "shell", + "case_offset_bz": "0", + "case_offset_tz": "0", + "case_offset_x": "0", + "case_offset_y": "50.5", + "cooling": "default", + "corner_fillet": "3", + "edge_fillet": "0", + "ext_bottom_front_left_adjust": "0", + "ext_bottom_front_left_enable": "true", + "ext_bottom_front_left_support": "front", + "ext_bottom_front_right_adjust": "0", + "ext_bottom_front_right_enable": "true", + "ext_bottom_front_right_support": "front", + "ext_bottom_rear_left_adjust": "0", + "ext_bottom_rear_left_enable": "true", + "ext_bottom_rear_left_support": "rear", + "ext_bottom_rear_right_adjust": "0", + "ext_bottom_rear_right_enable": "true", + "ext_bottom_rear_right_support": "rear", + "ext_bottom_sidewall_support": "true", + "ext_bottom_standoff_diameter": "5.75", + "ext_bottom_standoff_hole_size": "3.4", + "ext_bottom_standoff_insert": "false", + "ext_bottom_standoff_insert_dia": "4.2", + "ext_bottom_standoff_insert_height": "5.1", + "ext_bottom_standoff_pillar": "hex", + "ext_bottom_standoff_reverse": "false", + "ext_bottom_standoff_size": "m3", + "ext_bottom_standoff_support_height": "4", + "ext_bottom_standoff_support_size": "10", + "ext_bottom_standoff_type": "countersunk", + "ext_bottom_standoffs": "false", + "ext_top_front_left_adjust": "0", + "ext_top_front_left_enable": "true", + "ext_top_front_left_support": "front", + "ext_top_front_right_adjust": "0", + "ext_top_front_right_enable": "true", + "ext_top_front_right_support": "front", + "ext_top_rear_left_adjust": "0", + "ext_top_rear_left_enable": "true", + "ext_top_rear_left_support": "rear", + "ext_top_rear_right_adjust": "0", + "ext_top_rear_right_enable": "true", + "ext_top_rear_right_support": "rear", + "ext_top_sidewall_support": "true", + "ext_top_standoff_diameter": "5.75", + "ext_top_standoff_hole_size": "2.75", + "ext_top_standoff_insert": "false", + "ext_top_standoff_insert_dia": "4.2", + "ext_top_standoff_insert_height": "5.1", + "ext_top_standoff_pillar": "hex", + "ext_top_standoff_reverse": "true", + "ext_top_standoff_size": "m3", + "ext_top_standoff_support_height": "4", + "ext_top_standoff_support_size": "10", + "ext_top_standoff_type": "blind", + "ext_top_standoffs": "false", + "fan_size": "0", + "flat_blank_section": "false", + "floorthick": "2", + "gap": "1", + "gpio_opening": "default", + "indents": "true", + "individual_part": "bottom", + "lower_bottom": "0", + "material_thickness": "0.5", + "move_front": "0", + "move_leftside": "0", + "move_rear": "0", + "move_rightside": "0", + "pcb_loc_x": "0", + "pcb_loc_y": "0", + "pcb_loc_z": "0", + "raise_top": "0", + "rear_io_shield": "false", + "sbc_bottom_standoffs": "true", + "sbc_highlight": "false", + "sbc_information": "false", + "sbc_model": "cs-solarmeter", + "sbc_off": "false", + "sbc_top_standoffs": "true", + "sidethick": "2", + "standard_motherboard_thickness": "0", + "text_color": "Green", + "text_font": "Nimbus Mono PS", + "tol": "0.25", + "top_cover_pattern": "solid", + "top_front_left_adjust": "0", + "top_front_left_enable": "true", + "top_front_left_support": "front", + "top_front_right_adjust": "0", + "top_front_right_enable": "true", + "top_front_right_support": "front", + "top_rear_left_adjust": "0", + "top_rear_left_enable": "true", + "top_rear_left_support": "rear", + "top_rear_right_adjust": "0", + "top_rear_right_enable": "true", + "top_rear_right_support": "rear", + "top_sidewall_support": "false", + "top_standoff_diameter": "5.75", + "top_standoff_hole_size": "2.75", + "top_standoff_insert": "false", + "top_standoff_insert_dia": "4.2", + "top_standoff_insert_height": "5.1", + "top_standoff_pillar": "hex", + "top_standoff_reverse": "true", + "top_standoff_size": "m3", + "top_standoff_support_height": "4", + "top_standoff_support_size": "10", + "top_standoff_type": "blind", + "uart_opening": "default", + "view": "model", + "wallthick": "2" } }, "fileFormatVersion": "1" diff --git a/sbc_case_builder.scad b/sbc_case_builder.scad index 63305aa..33fa2aa 100644 --- a/sbc_case_builder.scad +++ b/sbc_case_builder.scad @@ -29,7 +29,7 @@ include <./sbc_case_builder_accessories.cfg>; view = "model"; // [model, platter, part] individual_part = "bottom"; // [top, bottom, right, left, front, rear, io_shield, accessories] // single board computer model -sbc_model = "c1+"; // ["c1+", "c2", "c4", "hc4", "xu4", "xu4q", "mc1", "hc1", "n1", "n2", "n2+", "n2l", "n2lq", "m1", "m1s", "h2", "h2+", "h3", "h3+", "h4", "h4+", "h4_ultra", "show2", "rpipico", "rpipicow", "rpicm4+ioboard", "rpicm1", "rpicm3", "rpicm3l", "rpicm3+", "rpicm4s", "rpicm4", "rpicm4l", "rpizero", "rpizerow", "rpizero2w", "rpi1a+", "rpi1b+", "rpi2b", "rpi3a+", "rpi3b", "rpi3b+", "rpi4b", "rpi5", "rock64", "rockpro64", "quartz64a", "quartz64b", "h64b", "star64", "rock4a", "rock4b", "rock4a+", "rock4b+", "rock4c", "rock4c+", "rock5b-v1.3", "rock5b", "rock5bq", "nio12l", "vim1", "vim2", "vim3", "vim3l", "vim4", "tinkerboard", "tinkerboard-s", "tinkerboard-2", "tinkerboard-2s", "tinkerboard-r2", "tinkerboard-r2s", "opizero", "opizero2", "opir1plus_lts", "opir1", "opi5", "jetsonnano", "lepotato", "sweetpotato", "tritium-h2+", "tritium-h3", "tritium-h5", "solitude", "alta", "atomicpi", "visionfive2", "visionfive2q", "licheerv+dock", "rak19007", "ssi-eeb", "ssi-ceb", "atx", "micro-atx", "dtx", "flex-atx", "mini-dtx", "mini-itx", "mini-itx_thin", "mini-stx", "mini-stx_thin", "nano-itx", "nuc", "pico-itx"] +sbc_model = "c1+"; // ["c1+", "c2", "c4", "hc4", "xu4", "xu4q", "mc1", "hc1", "n1", "n2", "n2+", "n2l", "n2lq", "m1", "m1s", "h2", "h2+", "h3", "h3+", "h4", "h4+", "h4_ultra", "show2", "rpipico", "rpipicow", "rpicm4+ioboard", "rpicm1", "rpicm3", "rpicm3l", "rpicm3+", "rpicm4s", "rpicm4", "rpicm4l", "rpizero", "rpizerow", "rpizero2w", "rpi1a+", "rpi1b+", "rpi2b", "rpi3a+", "rpi3b", "rpi3b+", "rpi4b", "rpi5", "rock64", "rockpro64", "quartz64a", "quartz64b", "h64b", "star64", "rock4a", "rock4b", "rock4a+", "rock4b+", "rock4c", "rock4c+", "rock5b-v1.3", "rock5b", "rock5bq", "nio12l", "vim1", "vim2", "vim3", "vim3l", "vim4", "tinkerboard", "tinkerboard-s", "tinkerboard-2", "tinkerboard-2s", "tinkerboard-r2", "tinkerboard-r2s", "opizero", "opizero2", "opir1plus_lts", "opir1", "opi5", "jetsonnano", "lepotato", "sweetpotato", "tritium-h2+", "tritium-h3", "tritium-h5", "solitude", "alta", "atomicpi", "visionfive2", "visionfive2q", "licheerv+dock", "rak19007", "nodemcu-32s", "cs-solarmeter", "ssi-eeb", "ssi-ceb", "atx", "micro-atx", "dtx", "flex-atx", "mini-dtx", "mini-itx", "mini-itx_thin", "mini-stx", "mini-stx_thin", "nano-itx", "nuc", "pico-itx"] // sbc off in model view sbc_off = false;