3d-stuff/openscad/own/kossel_2020_shells/kossel_2020_shells.scad

198 lines
8.8 KiB
OpenSCAD
Raw Normal View History

2020-10-11 02:27:48 +02:00
// Kossel bottom outer cover for 20x20 aluminium extrusion
// by zeus - zeus@ctdo.de - CC-BY-NC-4.0
// -> https://www.thingiverse.com/zeus
// -> https://github.com/zeus86
// 2020-10-01
//### global vars:
cover_h=60; //overall height to cover
cover_w=80; //overall width to cover (kossel mini default full widthwidth to cover is 240mm)
mt=2; //material thickness, applies to various things
scr_hole_dia=4.3; //screw hole diameter for mounting holes
tab_w=4.6; // width of the indented tab, which goes into the groove of the extruded beam
tab_h=1; //height of the tab
beam_h=20; // 20x20 beam
beam_w=beam_h;
showtext=1; // 0 or 1, show text or not
tabs=1; // 0,1,2,3, use tabs for 2020 beams (none,all,top,bottom)
$fn=100;
//### end of global vars, start of models
module plate(){
// socket baseplate
difference(){
union(){
cube([cover_w,cover_h,mt],center=true); //plate
if (tabs==1) {for (h=[cover_h/2-beam_w/2,-cover_h/2+beam_h/2]) translate([0,(h),mt/2+tab_h/2]) cube([cover_w,tab_w,tab_h],center=true);}; //recessed tabs (both)
if (tabs==2) {for (h=[-cover_h/2+beam_h/2]) translate([0,(h),mt/2+tab_h/2]) cube([cover_w,tab_w,tab_h],center=true);}; //recessed tabs (top)
if (tabs==3) {for (h=[cover_h/2-beam_w/2]) translate([0,(h),mt/2+tab_h/2]) cube([cover_w,tab_w,tab_h],center=true);}; //recessed tabs (bottom)
}
for (w=[cover_w/2-beam_h/2,-cover_w/2+beam_h/2],h=[cover_h/2-beam_w/2,-cover_h/2+beam_h/2]){ // for-loop to position the screw holes accordingly
translate([(w),(h),tab_h/2]) cylinder(r=scr_hole_dia/2,h=mt+tab_h+0.1,center=true); //screw-holes
}
}
}
module plate_extrahole(){
// socket baseplate but with extra holes on the tab
cutout_extrahole_dia=scr_hole_dia;
cutout_extrahole_w=10; //center-to-center
cutout_extrahole_offset=10;
difference(){
union(){
cube([cover_w,cover_h,mt],center=true); //plate
if (tabs==1) {for (h=[cover_h/2-beam_w/2,-cover_h/2+beam_h/2]) translate([0,(h),mt/2+tab_h/2]) cube([cover_w,tab_w,tab_h],center=true);}; //recessed tabs (both)
if (tabs==2) {for (h=[-cover_h/2+beam_h/2]) translate([0,(h),mt/2+tab_h/2]) cube([cover_w,tab_w,tab_h],center=true);}; //recessed tabs (top)
if (tabs==3) {for (h=[cover_h/2-beam_w/2]) translate([0,(h),mt/2+tab_h/2]) cube([cover_w,tab_w,tab_h],center=true);}; //recessed tabs (bottom)
}
for (w=[cover_w/2-beam_h/2,-cover_w/2+beam_h/2],h=[cover_h/2-beam_w/2,-cover_h/2+beam_h/2]){ // for-loop to position the screw holes accordingly
translate([(w),(h),tab_h/2]) cylinder(r=scr_hole_dia/2,h=mt+tab_h+0.1,center=true); //screw-holes
}
for (w=[-cutout_extrahole_w/2:0.5:cutout_extrahole_w/2],h=[-cover_h/2+beam_w/2]){ // for-loop for extra-holes
translate([(w-cutout_extrahole_offset),(h),tab_h/2]) cylinder(r=scr_hole_dia/2+0.2,h=mt+tab_h+0.1,center=true); //screw-holes
}
}
}
module cutout_xt60(){
// cutout for plate-mounted xt60-socket
cutout_xt60_screw_dia=3.5; //mounting screws
cutout_xt60_screw_spacing=20.5; //~20.5mm apart from each other (center to center)
cutout_xt60_w=16;
cutout_xt60_h=8.5;
cutout_xt60_text_h=5;
linear_extrude(height = mt+0.1, center = true, convexity = 1) {
polygon(points = [
[-cutout_xt60_w/2,-cutout_xt60_h/2],
[cutout_xt60_w/2-1,-cutout_xt60_h/2],
[cutout_xt60_w/2,-cutout_xt60_h*0.37],
[cutout_xt60_w/2,cutout_xt60_h*0.37],
[cutout_xt60_w/2-1,cutout_xt60_h/2],
[-cutout_xt60_w/2,cutout_xt60_h/2]
], paths=undef, convexity=1); //shape of the cutout
}
for (x=[cutout_xt60_screw_spacing/2,-cutout_xt60_screw_spacing/2]) translate([(x),0,0]) cylinder(r=cutout_xt60_screw_dia/2,h=mt+0.1,center=true); // screw holes
if (showtext==1) mirror([0,1,0])translate([0,cover_h/2-beam_h+1,-mt/2-0.1])linear_extrude(1)text("12V DC",cutout_xt60_text_h,halign="center",valign="center"); //some text
}
module cutout_usba(){
// cutout for plate-mounted USB-type-a-socket
cutout_usba_screw_dia=3.5; //mounting screws
cutout_usba_screw_spacing=30; //~30mm apart from each other (center to center)
cutout_usba_w=12.5;
cutout_usba_h=11.5;
cutout_usba_text_h=5;
cube([cutout_usba_w,cutout_usba_h,mt+0.1],center=true); //shape of the cutout
translate([0,0,mt/2]) cube([cutout_usba_screw_spacing+2*cutout_usba_screw_dia,cutout_usba_w*1.3,mt/2],center=true); //helper-plate for further recess into plate
for (x=[cutout_usba_screw_spacing/2,-cutout_usba_screw_spacing/2]) translate([(x),0,0]) cylinder(r=cutout_usba_screw_dia/2,h=mt+0.1,center=true); // screw holes
if (showtext==1) mirror([0,1,0])translate([0,cover_h/2-beam_h+1,-mt/2-0.1])linear_extrude(1)text("USB",cutout_usba_text_h,halign="center",valign="center"); //some text
}
module cutout_vmeter(){
// cutout for pcb-mounted 7-segment-LCD displaying a supplied voltage
cutout_vmeter_screw_spacing=26.5; //~30mm apart from each other (center to center)
cutout_vmeter_screw_dia=1.6; // module uses holes for M2.5, mounted from the inside on spacers!!
cutout_vmeter_w=23;
cutout_vmeter_h=10.5;
cutout_vmeter_d=6.5; //depth without pcb
cutout_vmeter_text_h=5;
cube([cutout_vmeter_w,cutout_vmeter_h,mt+0.1],center=true); //shape of the cutout
for (x=[cutout_vmeter_screw_spacing/2,-cutout_vmeter_screw_spacing/2]) translate([(x),0,0.25/2]) cylinder(r=cutout_vmeter_screw_dia/2,h=mt-0.25+0.01,center=true); // screw holes
if (showtext==1) mirror([0,1,0])translate([0,cover_h/2-beam_h+1,-mt/2-0.1])linear_extrude(1)text("V_IN",cutout_vmeter_text_h,halign="center",valign="center"); //some text
}
module cutout_socketswitch(){
cutout_socketswitch_dia=20;
cutout_socketswitch_w=16;
cutout_socketswitch_h=mt+0.1;
cutout_socketswitch_bump=5; //excess tabs width for clearance on press-fit/snap-in switches
cutout_socketswitch_text_h=5;
cylinder(r=cutout_socketswitch_dia/2,h=cutout_socketswitch_h,center=true); //shape of the cutout
for (r=[0,90])
rotate([0,0,(r)]) cube([cutout_socketswitch_dia+(cutout_socketswitch_bump/3),cutout_socketswitch_bump,cutout_socketswitch_h],center=true); // excess tabs
if (showtext==1) mirror([0,1,0])translate([0,cover_h/2-cutout_socketswitch_dia/2-cutout_socketswitch_bump*1.1,-mt/2-0.1])linear_extrude(1)text("ON/OFF",cutout_socketswitch_text_h,halign="center",valign="center"); //some text
}
module cutout_fangrill(){
cutout_fangrill_w=cover_w*0.85;
cutout_fangrill_h=cover_h-(2*beam_h)*0.85;
cutout_fangrill_text_h=4.5;
difference(){
cube([cutout_fangrill_w,cutout_fangrill_h,mt+0.1],center=true);
for (y=[-(cutout_fangrill_h/2-1):mt*2:(cutout_fangrill_h/2+1)]) translate([0,(y),0]) rotate([-45,0,0]) cube([cutout_fangrill_w+0.1,mt/2,mt*PI+0.1],center=true); // tilted slots
cube([mt+0.2,cutout_fangrill_h+0.1,mt+0.1+0.1],center=true);
}
if (showtext==1) mirror([0,1,0])translate([0,cover_h/2-beam_h/2,-mt/2-0.1])linear_extrude(1)
text("DELTAZEUS V2.1",cutout_fangrill_text_h,halign="center",valign="center"); //some text
}
module cutout_cableroute(){
cutout_cableroute_w=22;
cutout_cableroute_h=12;
cutout_cableroute_text_h=5;
cube([cutout_cableroute_w,cutout_cableroute_h,mt+0.1],center=true);
if (showtext==1) mirror([0,1,0])translate([0,cutout_cableroute_h,-mt/2-0.1])linear_extrude(1)
text("Display",cutout_cableroute_text_h,halign="center",valign="center"); //some text
}
module fullmodel_plain(){
// fullplate without any cutouts:
plate();
}
module fullmodel_testfit(){
// fullplate without any cutouts. 10%-version for testfit:
difference(){
plate();
translate([-cover_w/2-2.5,-cover_h/2-2.5,-(mt/2+1)]) #cube([cover_w*0.88+5,cover_h+5,mt+5]); // overlay to cut away 90% of the model to generate a model for testfit.
}
}
module fullmodel_powerplate(){
// full model, powerplate variant
difference(){
plate();
translate([-(cover_w/2-26),0,0]) cutout_socketswitch();
translate([(cover_w/2-24),0,0]) cutout_xt60();
}
}
module fullmodel_vmeterandusb(){
// full model, vmeter & usb-type-a variant
difference(){
plate();
translate([-(cover_w/2-20),0,0]) cutout_vmeter();
translate([(cover_w/2-18),0,0]) cutout_usba();
}
}
module fullmodel_fangrill(){
// full model, fan grill for air exhaust
difference(){
plate();
translate([0,0,0]) cutout_fangrill();
//translate([(cover_w/2-18),0,0]) cutout_usba();
}
}
module fullmodel_cableroute(){
// full model with hole for display-cables
difference(){
plate();
translate([0,0,0]) cutout_cableroute();
}
}
module fullmodel_extrahole(){
// full model with hole for display-mounting-holes
plate_extrahole();
}
//cutout_extrahole();
fullmodel_powerplate();