Skip to content

Instantly share code, notes, and snippets.

@mritzco
Created February 27, 2018 10:12
Show Gist options
  • Save mritzco/2205236ca6bb19d57c7d7493da3e5d53 to your computer and use it in GitHub Desktop.
Save mritzco/2205236ca6bb19d57c7d7493da3e5d53 to your computer and use it in GitHub Desktop.
HDD holder
// hard disk holder
module stand(
wall=3,
height=20,
dw=20,
dd=80
) {
wall2 = wall*2;
difference() {
cube( [dw+wall2, dd+wall2, height]);
translate([wall,wall,wall])
cube( [dw, dd, height-wall]);
}
}
// sumv function by https://www.thingiverse.com/MichaelAtOz/about
// https://www.thingiverse.com/thing:70745
function sumv(v,i,s=0) = (i==s ? v[i] : v[i] + sumv(v,i-1,s));
module multistand(
wall = 3,
height = 20,
deepness = 80,
disks = [20,24,26]
) {
union(){
for (j = [0: len(disks)-1]) {
move = sumv(disks,j) - disks[j] ;
walls = wall * j;
//echo(disks[j], move, disks[j]);
translate([ move + walls,0,0])
stand(wall, height, disks[j], deepness);
}
}
}
wall=3; // mm
height=30;
deep = 140;
disks = [20,20,18,40];
multistand(wall,height,deep, disks);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment