3d-stuff/openscad/own/hex-rackpanels/hexpanel.scad

72 lines
2.6 KiB
OpenSCAD

// hexagonal magnetic panels for serverracks
// by zeus - 2022-09-23 - CC-BY-SA-NC-4.0
// https://git.kostianix.de/zeus/3d-stuff/src/branch/main/openscad/own/hex-rackpanels
// ##########################################
// VARS:
$fn=100;
q=0.01; // only used to get rid of visual glitches
sides=6; // whyever you want to change this...
panel_dia=125; // overall diameter (largest diameter, not the distance of the parallel sides!)
mt=3; // material thickness, NOT overall thickness in case of a rim!
rim_t=mt; // thickness of the surrounding rim
rim_h=2; // height of the surroundig rim
logo_d=rim_h; // thickness of the embossing
magnet_count=4; // count of magnets
magnet_dia=10; // diameter of the magnet-recesses
magnet_h=1; // height of the magnets
// ##########################################
// MODULES:
module panel(){
difference(){
cylinder(d=panel_dia,h=mt+rim_h,$fn=sides);
translate([0,0,mt+q])cylinder(d=panel_dia-2*rim_t,h=rim_h,$fn=sides);
if (magnet_count==1){
translate([0,0,-q])cylinder(d=magnet_dia,h=magnet_h);
}
if (magnet_count>1){
for (m=[1:360/magnet_count:359]){
rotate([0,0,m]){
translate([panel_dia/4,0,-q]){
cylinder(d=magnet_dia,h=magnet_h);
}
}
}
}
}
}
module logo(path,scale){
translate([0,0,mt]){
scale([scale,scale,1]){
linear_extrude(logo_d){
import(path,center=true);
}
}
}
}
// ##########################################
// DRAW MODEL:
panel();
//logo("SRC/truenas-core_logo_plain.svg",10); //truenas-core
//logo("SRC/freenas-logo_plain.svg",0.5); //freenas
//logo("SRC/truenas-scale_logo_plain.svg",1.25); // truenas-scale
//logo("SRC/pfsense-logo_plain.svg",8.5); // pfsense
//logo("SRC/proxmox-logo_plain.svg",7); // proxmox
//logo("SRC/grafana-logo_plain.svg",8); // grafana
//logo("SRC/ansible_alt-logo_plain.svg",0.125); // ansible
//translate([-7,0,0])logo("SRC/ubuntu-logo_plain.svg",0.5); // ubuntu
//logo("SRC/debian-logo_plain.svg",12.5); // debian
//logo("SRC/openvpn-logo_plain.svg",0.15); // openvpn
//logo("SRC/wireguard-logo_plain.svg",7.5); // wireguard
//translate([0,5,0])logo("SRC/jellyfin-logo_plain.svg",0.4); // jellyfin
//logo("SRC/docker-logo_plain.svg",7.5); // docker
//logo("SRC/nextcloud-logo_plain.svg",7.5); // nextcloud
//translate([0,5,0])logo("SRC/homeassistant-logo_plain.svg",0.45); // homeassistant
//logo("SRC/ubiquity-logo_plain.svg",1.5); // ubiquity
logo("SRC/gitlab-logo_plain.svg",15); // gitlab
//logo("SRC/gitea-logo_plain.svg",10); // gitea