more cleanup and documentation

This commit is contained in:
Edward Kisiel
2024-01-31 21:36:04 -05:00
parent a33450ac21
commit e5b9e8263c
17 changed files with 1673 additions and 748 deletions

View File

@@ -1,12 +1,43 @@
/*
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 <http://www.gnu.org/licenses/>
Code released under GPLv3: http://www.gnu.org/licenses/gpl.html
vent(width, length, height, gap, rows, columns, orientation)
vent_hex(cells_x, cells_y, thickness, cell_size, cell_spacing, orientation)
vent_panel_hex(x, y, thick, cell_size, cell_spacing, border, borders);
*/
// vent opening
module vent(width,length,height,gap,rows,columns,orientation) {
/*
NAME: vent
DESCRIPTION: creates vent mask patterns
TODO: none
USAGE: vent(width, length, height, gap, rows, columns, orientation)
width = coloumn size_x
length = column size_y
height = size_z
gap = space between
rows = #row
columns = #columns
orientation = "horizontal", "vertical"
*/
module vent(width, length, height, gap, rows, columns, orientation) {
fillet = width/2;
adjust = .01;
@@ -18,7 +49,7 @@ module vent(width,length,height,gap,rows,columns,orientation) {
for (c=[0:width+(2*gap):(columns*(width+(2*gap)))-1]) {
translate ([c,r,-1]) cube([width,length,height]);
}
}
}
}
// horizontal orientation
if(orientation == "horizontal") {
@@ -30,7 +61,23 @@ module vent(width,length,height,gap,rows,columns,orientation) {
}
}
// Hex vent opening
/*
NAME: vent_hex
DESCRIPTION: creates hex vent mask patterns
TODO: none
USAGE: vent_hex(cells_x, cells_y, thickness, cell_size, cell_spacing, orientation)
cells_x = #rows
cells_y = #columns
thickness = pattern thickness
cell_size = size of hex
cell_spacing = space between hex
orientation = "horizontal", "vertical"
*/
module vent_hex(cells_x, cells_y, thickness, cell_size, cell_spacing, orientation) {
xs = cell_size + cell_spacing;
ys = xs * sqrt(3/4);
@@ -53,14 +100,23 @@ module vent_hex(cells_x, cells_y, thickness, cell_size, cell_spacing, orientatio
}
/*
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"
*/
/* hex vent panel */
// borders:
// y - specified size along y axis
// x - specified size along x axis
// none - both borders the size of cell_spacing, no mounting holes
// anything else ("default") - all borders of specified size
//
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;
@@ -75,13 +131,13 @@ module vent_panel_hex(x, y, thick, cell_size=8, cell_spacing=3, border=3, border
difference() {
color("grey",1) slab([x,y,thick],2);
color("grey",1) translate([(x-csx)/2,(y-csy)/2,-1])
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);
}
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);
}
}
}