fixed fan_2 mask, created shared fan and heatsink mask code and readme.md updates and corrections

This commit is contained in:
Edward Kisiel
2024-05-10 21:57:12 -04:00
parent ba9832a972
commit 62d6d15389
3 changed files with 6 additions and 281 deletions

View File

@@ -141,22 +141,22 @@ Class “add1” and “add2” are used to add geometry to the case. The differ
**additive type:** **additive type:**
circle, rectangle, slot, text, art, standoff, batt_holder, uart_holder, hd_holder, hd_holes, hd_vertright_holes, hc4_oled_holder, access_panel, button, pcb_holder, boom_grill, boom_speaker_holder art, access_panel, batt_holder, button, button_assembly, fan_cover, feet, hd_holder, hk_boom_grill, hk_boom_speaker_holder, hk_boom_vring, hk_h3_port_extender_holder, hk_hc4_oled_holder, hk_uart_holder, hk_uart_strap, keyhole, nut_holder, pcb_holder, rectangle, round, slot, sphere, standoff, text, vent_panel_hex, uart_holder, hc4_oled_holder, button, pcb_holder
**subtractive type:** **subtractive type:**
circle, rectangle, slot, text, art, punchout, vent, fan, hd_holes, hd_vertleft_holes, hd_vertright_holes, microusb, sphere art, fan_mask, hd_holes, knockout, rectangle, round, slot, sphere, text, vent, vent_hex
**model type:** **model type:**
uart_strap, fan_cover, hd25, hd35, hc4_oled, feet, access_cover, net_card, hk35_lcd, hk_boom, boom_speaker, boom_vring, hk_uart access_cover, adafruit_lcd, dsub, fan, hd25, hd35, hk_boom, hk_boom_speaker, hk_h3_port_extender, hk_hc4_oled, hk35_lcd, hk_m1s_ups, hk_net_card, hk_pwr_button, hk_speaker, hk_uart, hk_vu7c, hk_vu8m, hk_vu8s, hk_wb2, hk_xu4_shifter_shield, stl_model
**platter type:** **platter type:**
uart_strap, fan_cover, access_cover, button_assembly, boom_vring access_cover, button_assembly, fan_cover, feet, hk_boom_vring, hk_h3_port_extender_holder, hk_uart_strap, vent_panel_hex
## Accessory Reference Manual ## Accessory Reference Manual
@@ -1305,7 +1305,7 @@ DESCRIPTION: creates db connectors.
rotation[] = object rotation rotation[] = object rotation
parametric[] = "case", "sbc", "sbc-case_z" parametric[] = "case", "sbc", "sbc-case_z"
size[] = not used size[] = not used
data[0] = "box30x10","box40x10","box50x10","box60x10","box80x10","box80x25","box92x10","box92x25","box120x25","box140x25" data[0] = "box25x10","box30x10","box40x10","box50x10","box60x10","box80x10","box80x25","box92x10","box92x25","box120x25","box140x25"
mask[0] = true mask[0] = true
mask[1] = length mask[1] = length
mask[2] = set back mask[2] = set back

View File

@@ -130,278 +130,3 @@ module fan_cover(size, thick, style) {
color("grey", 1) fan_mask(size, thick, style); color("grey", 1) fan_mask(size, thick, style);
} }
} }
/*
DESCRIPTION: creates fan masks for openings
TODO:
USAGE: fan_mask(size, thick, style)
size = size of fan
thick = thickness of cover
style = "fan_open", "fan_1", "fan_2", "fan_hex"
*/
module fan_mask(size, thick, style) {
hole_pos = size == 25 ? 2.5 :
size == 30 ? 3 :
size == 40 ? 4 :
size == 50 || size == 60 || size == 70 ? 5 :
size >= 80 ? 3.75 : 3.75;
$fn = 90;
adj = .01;
if(style == "fan_open") {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-1);
// mount holes
translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3);
}
if(style == "fan_1" && size == 25) {
union() {
difference() {
union () {
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-2);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-8);
}
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-11);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-17);
}
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-20);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-25);
}
// mount holes
translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3);
}
translate([4, 3, -2]) rotate([0, 0, 45]) cube([size, 1.5, thick+4]);
translate([3, size-4, -2]) rotate([0, 0, -45]) cube([size, 1.5, thick+4]);
}
}
}
if(style == "fan_1" && size == 30) {
union() {
difference() {
union () {
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-2);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-8);
}
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-11);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-17);
}
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-20);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-25);
}
// mount holes
translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3);
}
translate([5, 4, -2]) rotate([0, 0, 45]) cube([size, 1.5, thick+4]);
translate([4, size-5, -2]) rotate([0, 0, -45]) cube([size, 1.5, thick+4]);
}
}
}
if(style == "fan_1" && size == 40) {
union() {
difference() {
union () {
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-2);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-8);
}
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-11);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-17);
}
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-20);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-25);
}
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-28);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-35);
}
// mount holes
translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3);
}
translate([6.5, 5.5, -2]) rotate([0, 0, 45]) cube([size, 1.5, thick+4]);
translate([5, size-6, -2]) rotate([0, 0, -45]) cube([size, 1.5, thick+4]);
}
}
}
if(style == "fan_1" && (size == 50 || size == 60 || size == 70)) {
union() {
difference() {
union () {
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-2);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-14);
}
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-18);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-30);
}
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-34);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-46);
}
if(size > 50) {
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-50);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-59);
}
}
// mount holes
translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3);
}
translate([8.5, 7, -2]) rotate([0, 0, 45]) cube([size > 60 ? size+4 : size+1, 2, thick+4]);
translate([6.5, size-8, -2]) rotate([0, 0, -45]) cube([size > 60 ? size+4 : size+1, 2, thick+4]);
}
}
}
if(style == "fan_1" && size >= 80) {
union() {
difference() {
union () {
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-2);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-9);
}
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-14);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-21);
}
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-26);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-33);
}
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-38);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-45);
}
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-50);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-57);
}
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-62);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-68);
}
if(size == 92) {
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-74);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-80);
}
difference() {
translate([size/2, size/2, -1]) cylinder(h=thick+2, d=size-85);
translate([size/2, size/2, -2]) cylinder(h=thick+4, d=size-91);
}
}
// mount holes
translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3);
}
translate([6.5, 4.25, -2]) rotate([0, 0, 45]) cube([size*1.2, 3, thick+4]);
translate([4.25, size-6.5, -2]) rotate([0, 0, -45]) cube([size*1.2, 3, thick+4]);
}
}
}
if(style == "fan_2") {
inner = size == 25 ? 20 :
size == 30 ? 24 :
size == 40 ? 32 :
size == 50 ? 40 :
size == 60 ? 50 :
size == 70 ? 61.9 :
size == 80 ? 71.5 :
size * 0.8; // Use 80% as default
rings = size <= 40 ? 4 : 6;
bar_size = size <= 40 ? 2 : 3;
screw_offset = inner / 2;
center_point = size * 0.5;
base_ring_size = size * 0.95;
rings_spacing = size / rings;
translate([size/2, size/2, -1])
union() {
translate([screw_offset, screw_offset, (thick+2)/2]) cylinder(d=3, h=thick+2, center=true);
translate([-screw_offset, screw_offset, (thick+2)/2]) cylinder(d=3, h=thick+2, center=true);
translate([screw_offset, -screw_offset, (thick+2)/2]) cylinder(d=3, h=thick+2, center=true);
translate([-screw_offset, -screw_offset, (thick+2)/2]) cylinder(d=3, h=thick+2, center=true);
difference() {
union() {
for(i=[inner:-rings_spacing:0]) {
difference() {
cylinder(d=base_ring_size - i, h=thick+2);
translate([0, 0, -1]) cylinder(d=base_ring_size - i - (rings_spacing/2), h=thick+4);
}
}
}
union() {
cylinder(d=bar_size*3+0.1, thick+2); // Add a circle to prevent any tiny holes around cross bar
#translate([0,0,1+thick/2]) rotate([0, 0, 45]) cube([size, bar_size, thick+2], center=true);
#translate([0,0,1+thick/2]) rotate([0, 0, 45]) cube([bar_size, size, thick+2], center=true);
}
}
}
}
if(style == "fan_hex") {
hex_pos = size == 25 ? [-14.25, -7, 0] :
size == 30 ? [-11.75, -4.5, 0] :
size == 40 ? [-14, -11.25, 0] :
size == 50 ? [-16, -6.5, 0] :
size == 60 ? [-11, -1.5, 0] :
size == 70 ? [-13, -3.5, 0] :
size >= 80 ? [-8.25, -3.5, 0] : [-9, -4, 0];
union() {
difference () {
translate([1+(size-2)/2, 1+(size-2)/2, -1]) cylinder(h=thick+2, d=size-2);
union() {
difference() {
translate([1+(size-2)/2, 1+(size-2)/2, -1-adj]) cylinder(h=thick+3, d=size-2);
translate(hex_pos) vent_hex(15, 8, thick+4, 12, 2, "horizontal");
}
}
}
}
// mount holes
translate([size-hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([size-hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([hole_pos, size-hole_pos, -1]) cylinder(h=thick+2, d=3);
translate([hole_pos, hole_pos, -1]) cylinder(h=thick+2, d=3);
}
}