3d-stuff/openscad/own/rgb-fanblock/rgb-fanblock.scad

71 lines
2.6 KiB
OpenSCAD
Raw Normal View History

2023-04-23 00:04:47 +02:00
// by zeus - zeus@ctdo.de - CC-BY-NC-4.00
// -> https://www.thingiverse.com/zeus
// -> https://www.printables.com/social/366928-zeus/about
// -> https://github.com/zeus86
// -> https://blog.tastatursport.de/
// 2023-04-22
// RGB-Fanblock - Block of a 120mm Fan-Cutout with some RGB-Plating
//##################
//
// VARS
mt=4;
hole_dia=4.5;
hole_dist=105; // nominal hole-distance for 120mm-fans: 105mm
hole_dist_v=hole_dist-20; // vertical hole-distance (to enable non-square-designs)
height=hole_dist_v+hole_dia+(2.5*mt); // overall height
width=hole_dist+hole_dia+(2.5*mt); // overall width
height_inner=80+1;
width_inner=80+1;
depth=mt;
text_h=10;
q=0.01;
$fn=100;
use <SRC/StencilGothic.ttf>
// #################
// MODULES
module baseplate(plate_t=depth){
difference(){
hull(){ // "complex" basic-cube with rounded edges made from a hull-element
for (x=[-(width/2-mt/2),(width/2-mt/2)], z=[-(height/2-mt/2),(height/2-mt/2)]){
translate([x,0,z])rotate([90,0,0])cylinder(r=hole_dia/2,h=plate_t,center=true);
}
}
//cube([width,depth,height],center=true);
for (x=[-hole_dist/2,hole_dist/2], z=[-hole_dist_v/2,hole_dist_v/2]){
translate([x,0,z])rotate([90,0,0])#cylinder(r=hole_dia/2,h=plate_t+q,center=true);
}
}
}
module distanceplate(plate_d=depth,cut_w=width_inner,cut_h=height_inner,cableslot=0,cableslot_h=0){
plate_t=plate_d;
difference(){
baseplate(plate_t);
cube([cut_w,plate_d+q,cut_h],center=true);
if (cableslot==1){
translate([width/4,0,0])cube([width/2+1,plate_d+q,cableslot_h],center=true);
}
}
}
module faceplate(plate_d=depth,text_value1,text_value2,fontsize){
plate_f=plate_d;
difference(){
baseplate(plate_f);
//cube([width_inner,plate_d+q,height_inner],center=true);
translate([0,plate_f/2+q,0])rotate([90,0,0])linear_extrude(plate_f+2*q){
translate([0, fontsize*0.7,0])text(text_value1, size=fontsize, font="Stencil Gothic:style=Regular", halign="center",valign="center");
translate([0,-fontsize*0.7,0])text(text_value2, size=fontsize, font="Stencil Gothic:style=Regular", halign="center",valign="center");
}
}
}
//
// #################
// DRAWING
translate([0,0,0])baseplate(2); // bottom layer
translate([20,-30,0])distanceplate(2,25,25,1,10); // plate for cableruns
translate([40,-60,0])distanceplate(3); // plate for the PCB to be resting in
%translate([60,-90,0])baseplate(2);// transparent or white layer
translate([80,-120,0])faceplate(2,"ZEUS","AQUA",25);// faceplate with text