From 2979144e28a6bcdcc06ea4392a8d5a99d08d79c4 Mon Sep 17 00:00:00 2001 From: Edward Kisiel Date: Fri, 25 Apr 2025 22:00:34 -0400 Subject: [PATCH] minor gui format change, lib/vent.scad replaced --- lib/vent.scad | 63 +++++++++++++++++++++++++++++++++++ sbc_case_builder.scad | 17 +++++----- sbc_case_builder_library.scad | 1 + 3 files changed, 72 insertions(+), 9 deletions(-) create mode 100644 lib/vent.scad diff --git a/lib/vent.scad b/lib/vent.scad new file mode 100644 index 0000000..906d43a --- /dev/null +++ b/lib/vent.scad @@ -0,0 +1,63 @@ +/* + This file is part of SBC Case Builder https://github.com/hominoids/SBC_Case_Builder + Copyright 2022,2023,2024 Edward A. Kisiel hominoid@cablemi.com + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see + Code released under GPLv3: http://www.gnu.org/licenses/gpl.html + + vent_panel_hex(x, y, thick, cell_size, cell_spacing, border, borders); + +*/ + + +/* + NAME: vent_panel_hex + DESCRIPTION: creates hex vent panel + TODO: none + + USAGE: vent_panel_hex(x, y, thick, cell_size=8, cell_spacing=3, border=3, borders="default") + + x = #rows + y = #columns + thick = pattern thickness + cell_size = size of hex + cell_spacing = space between hex + border = size of borber + borders = "none", "default" + +*/ + +module vent_panel_hex(x, y, thick, cell_size=8, cell_spacing=3, border=3, borders="default") { + hole = 3.2; + xb = (borders == "y" || borders == "none") ? cell_spacing : border; + yb = (borders == "x" || borders == "none") ? cell_spacing : border; + hxb = max(yb/2, cell_spacing + hole); + hyb = max(xb/2, cell_spacing + hole); + + cells_x = floor((2*(x-2*xb-cell_size)/(cell_size+cell_spacing))+1); + cells_y = floor(((sqrt(12)*(y-2*yb)-4*cell_size)/(3*(cell_size+cell_spacing)))+1); + csx = cell_size + (cells_x-1)*(cell_size+cell_spacing)/2; + csy = sqrt(4/3)*cell_size + ((cell_size+cell_spacing)*sqrt(3/4)*(cells_y-1)); + + difference() { + color("grey",1) slab([x,y,thick],2); + color("grey",1) translate([(x-csx)/2,(y-csy)/2,-1]) + vent_hex(cells_x, cells_y, thick+3, cell_size, cell_spacing, "horizontal"); + if (borders != "none") { + color("grey",1) translate([ hxb, hyb, -1]) cylinder(d=hole, h=thick+3); + color("grey",1) translate([x - hxb, hyb, -1]) cylinder(d=hole, h=thick+3); + color("grey",1) translate([ hxb, y - hyb, -1]) cylinder(d=hole, h=thick+3); + color("grey",1) translate([x - hxb, y - hyb, -1]) cylinder(d=hole, h=thick+3); + } + } +} \ No newline at end of file diff --git a/sbc_case_builder.scad b/sbc_case_builder.scad index 40bcccf..73eaf81 100644 --- a/sbc_case_builder.scad +++ b/sbc_case_builder.scad @@ -159,7 +159,6 @@ accessory_name = "none"; // ["none", "hk_uart", "c4_shell_boombox", "c4_desktop_ text_color = "Green"; // [Green, Black, Dimgrey, White, Yellow, Orange, Red, DarkbBlue] // sbc information text font text_font = "Nimbus Mono PS"; // [Nimbus Mono PS, Liberation Mono, Noto Sans Mono] - /* [SBC Top Standoff Global Settings] */ // enable case top standoffs sbc_top_standoffs = true; @@ -232,7 +231,7 @@ bottom_front_right_enable = true; bottom_front_right_adjust = 0; //[-30:.01:30] bottom_front_right_support = "front"; //[none,left,rear,front,right] -/* [Extended Case Top Standoffs] */ +/* [ Extended Case Top Standoffs] */ // enable case extended standoffs ext_top_standoffs = false; ext_top_standoff_reverse = true; @@ -248,7 +247,7 @@ ext_top_standoff_support_height = 4; //[0:.01:50] ext_top_standoff_insert = false; ext_top_standoff_insert_dia = 4.2; //.01 ext_top_standoff_insert_height = 5.1; //.01 -/* [Extended Case Top Standoff Individual Settings] */ +/* [ Extended Case Top Standoff Individual Settings] */ // extended case top - lower left standoff settings ext_top_rear_left_enable = true; ext_top_rear_left_adjust = 0; //[-20:.01:20] @@ -266,7 +265,7 @@ ext_top_front_right_enable = true; ext_top_front_right_adjust = 0; //[-20:.01:20] ext_top_front_right_support = "front"; //[none,left,rear,front,right] -/* [Extended Case Bottom Standoffs] */ +/* [ Extended Case Bottom Standoffs] */ // enable case bottom extended standoffs ext_bottom_standoffs = false; ext_bottom_standoff_reverse = false; @@ -283,7 +282,7 @@ ext_bottom_standoff_insert = false; ext_bottom_standoff_insert_dia = 4.2; //.01 ext_bottom_standoff_insert_height = 5.1; //.01 -/* [Extended Case Bottom Standoff Individual Settings] */ +/* [ Extended Case Bottom Standoff Individual Settings] */ // extended case bottom - rear left standoff settings ext_bottom_rear_left_enable = true; ext_bottom_rear_left_adjust = 0; //[-20:.01:20] @@ -301,7 +300,7 @@ ext_bottom_front_right_enable = true; ext_bottom_front_right_adjust = 0; //[-20:.01:20] ext_bottom_front_right_support = "front"; //[none,left,rear,front,right] -/* [Multiple PCB Top Standoffs] */ +/* [ Multiple PCB Top Standoffs] */ // enable multiple pcb standoffs multipcb_top_standoffs = false; multipcb_top_standoff_reverse = true; @@ -317,7 +316,7 @@ multipcb_top_standoff_support_height = 4; //[0:.01:50] multipcb_top_standoff_insert = false; multipcb_top_standoff_insert_dia = 4.2; //.01 multipcb_top_standoff_insert_height = 5.1; //.01 -/* [Multiple PCB Top Standoff Individual Settings] */ +/* [ Multiple PCB Top Standoff Individual Settings] */ // multiple pcb top - lower left standoff settings multipcb_top_rear_left_enable = true; multipcb_top_rear_left_adjust = 0; //[-20:.01:20] @@ -335,7 +334,7 @@ multipcb_top_front_right_enable = true; multipcb_top_front_right_adjust = 0; //[-20:.01:20] multipcb_top_front_right_support = "front"; //[none,left,rear,front,right] -/* [Multiple PCB Bottom Standoffs] */ +/* [ Multiple PCB Bottom Standoffs] */ // enable multiple pcb extended standoffs multipcb_bottom_standoffs = false; multipcb_bottom_standoff_reverse = false; @@ -352,7 +351,7 @@ multipcb_bottom_standoff_insert = false; multipcb_bottom_standoff_insert_dia = 4.2; //.01 multipcb_bottom_standoff_insert_height = 5.1; //.01 -/* [Multiple PCB Bottom Standoff Individual Settings] */ +/* [ Multiple PCB Bottom Standoff Individual Settings] */ // multiple pcb bottom - rear left standoff settings multipcb_bottom_rear_left_enable = true; multipcb_bottom_rear_left_adjust = 0; //[-20:.01:20] diff --git a/sbc_case_builder_library.scad b/sbc_case_builder_library.scad index dc89dcb..34e9cef 100644 --- a/sbc_case_builder_library.scad +++ b/sbc_case_builder_library.scad @@ -51,3 +51,4 @@ include <./lib/oem_adafruit.scad>; include <./lib/oem_hk.scad>; include <./lib/oem_rpi.scad>; include <./lib/standoff.scad>; +include <./lib/vent.scad>;