3d/Matekiste_Laser_Stencil.scad

307 lines
9.7 KiB
OpenSCAD
Raw Normal View History

// top plane:
//round_psu_cable_fan_plane(360, 250, 6.5, 300, 180, 10, 41, 83, 90, 90);
// middle plane:
// round_psu_mainboard_plane(360, 250, 6.5, 300, 180, 10, 41, 83);
// bottom plane:
round_base_plane(360, 250, 6.5, 300, 180, 10);
2018-02-15 22:50:26 +00:00
// HDD plane:
// round_psu_cable_hdd_plane(360, 250, 6.5, 300, 180, 10, 41, 83, 90, 90);
2017-12-20 18:31:41 +00:00
RESOLUTION=36;
2017-12-20 19:02:39 +00:00
/*
* Simple, base angular plane with four holes
*/
2017-12-20 18:31:41 +00:00
module base_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y) {
difference() {
// base square
square([width, height]);
// holes
translate([(width-hole_spacing_x)/2, (height-hole_spacing_y)/2])
2017-12-20 18:31:41 +00:00
circle(d=hole_size, $fn=RESOLUTION);
translate([hole_spacing_x+(width-hole_spacing_x)/2, (height-hole_spacing_y)/2])
2017-12-20 18:31:41 +00:00
circle(d=hole_size, $fn=RESOLUTION);
translate([(width-hole_spacing_x)/2, height-(height-hole_spacing_y)/2])
2017-12-20 18:31:41 +00:00
circle(d=hole_size, $fn=RESOLUTION);
translate([hole_spacing_x+(width-hole_spacing_x)/2, height-(height-hole_spacing_y)/2])
2017-12-20 18:31:41 +00:00
circle(d=hole_size, $fn=RESOLUTION);
}
}
2017-12-20 19:02:39 +00:00
/*
* base_plane(...) with rounded edges, using helper function __radius_cutout(...)
*/
2017-12-20 18:31:41 +00:00
module round_base_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius) {
2017-12-21 14:17:43 +00:00
intersection() {
2017-12-20 18:31:41 +00:00
base_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y);
2017-12-21 14:17:43 +00:00
__round_square(width, height, radius);
2017-12-20 18:31:41 +00:00
}
}
2017-12-20 19:02:39 +00:00
/*
* Rounded base plane with cutout for the PSU
*/
2017-12-20 18:52:07 +00:00
module round_psu_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius, psu_width, psu_height) {
difference() {
round_base_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius);
translate([width-psu_width, height/2-psu_height/2])
square([psu_width, psu_height]);
}
}
2017-12-20 19:02:39 +00:00
/*
* Rounded base plane with cutout for cables
*/
2017-12-20 18:53:13 +00:00
module round_cable_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius, cable_width, cable_height) {
difference() {
round_base_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius);
2017-12-20 19:19:04 +00:00
difference() {
union() {
translate([0, height/2-cable_height/2])
square([cable_width, cable_height]);
// Outer rounds
translate([radius, height/2-cable_height/2-radius])
rotate([0, 0, 90])
__radius_cutout(radius);
translate([radius, height/2+cable_height/2+radius])
rotate([0, 0, 180])
__radius_cutout(radius);
}
// Inner rounds
translate([cable_width-radius, height/2+cable_height/2-radius])
__radius_cutout(radius);
translate([cable_width-radius, height/2-cable_height/2+radius])
rotate([0, 0, 270])
__radius_cutout(radius);
}
2017-12-20 18:53:13 +00:00
}
}
2017-12-20 18:52:07 +00:00
2017-12-20 19:02:39 +00:00
/*
* Base plane with combined cutouts: for PSU and for cables
*/
2017-12-20 18:57:52 +00:00
module round_psu_cable_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius, psu_width, psu_height, cable_width, cable_height) {
intersection() {
round_psu_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius, psu_width, psu_height);
round_cable_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius, cable_width, cable_height);
}
}
2017-12-21 16:47:45 +00:00
/*
* Base plane with combined cutouts: for PSU and mainboard bearings
*/
module round_psu_mainboard_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius, psu_width, psu_height) {
difference() {
round_psu_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius, psu_width, psu_height);
rotate([0, 0, 180])
translate([-310, -244])
__mainboard_bearings(230, 244);
}
}
2017-12-21 15:21:30 +00:00
/*
* Base plane with cutouts for two fans in the center
*/
module round_fan_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius) {
difference() {
round_base_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius);
// lower fan
translate([width/2-120/2, height/4-120/2])
__fan_cutout(120, 105, 5);
// upper fan
translate([width/2-120/2, height*3/4-120/2])
__fan_cutout(120, 105, 5);
}
}
/*
* Base plane with cutouts for psu, cables and fans
*/
module round_psu_cable_fan_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius, psu_width, psu_height, cable_width, cable_height) {
intersection() {
round_psu_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius, psu_width, psu_height);
round_cable_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius, cable_width, cable_height);
round_fan_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius);
}
}
2018-02-15 22:50:26 +00:00
/*
* HDD bearing plane with cutouts for psu and cables
*/
module round_psu_cable_hdd_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius, psu_width, psu_height, cable_width, cable_height) {
difference() {
intersection() {
round_psu_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius, psu_width, psu_height);
round_cable_plane(width, height, hole_size, hole_spacing_x, hole_spacing_y, radius, cable_width, cable_height);
}
// lower HDD 115
translate([width/2-145/2, height/2 - 10])
rotate([0, 0, -90])
__35_hdd_bearings(5);
// upper HDD 235
translate([width/2-145/2, height/2 - 10 + 120])
rotate([0, 0, -90])
__35_hdd_bearings(5);
}
}
2017-12-20 19:02:39 +00:00
/*
* Helper function for round edges
*/
2017-12-20 18:31:41 +00:00
module __radius_cutout(radius) {
difference() {
translate([radius/2, radius/2, 0])
square([radius, radius], center=true);
circle(radius, $fn=RESOLUTION);
}
2017-12-21 14:17:43 +00:00
}
/*
* Helper function for square with round edges
*/
module __round_square(width, height, radius) {
difference() {
square([width, height]);
translate([width-radius, height-radius])
__radius_cutout(radius);
translate([radius, height-radius])
rotate([0, 0, 90])
__radius_cutout(radius);
translate([radius, radius])
rotate([0, 0, 180])
__radius_cutout(radius);
translate([width-radius, radius])
rotate([0, 0, 270])
__radius_cutout(radius);
}
2017-12-21 15:21:30 +00:00
}
/*
* Helper function for fan cutout
*/
module __fan_cutout(outer_size, inner_size, bearing_size) {
// Bearing
translate([outer_size-(outer_size-inner_size)/2, outer_size-(outer_size-inner_size)/2])
circle(d=bearing_size, $fn=RESOLUTION);
2017-12-21 15:21:30 +00:00
translate([(outer_size-inner_size)/2, outer_size-(outer_size-inner_size)/2])
circle(d=bearing_size, $fn=RESOLUTION);
2017-12-21 15:21:30 +00:00
translate([outer_size-(outer_size-inner_size)/2, (outer_size-inner_size)/2])
circle(d=bearing_size, $fn=RESOLUTION);
2017-12-21 15:21:30 +00:00
translate([(outer_size-inner_size)/2, (outer_size-inner_size)/2])
circle(d=bearing_size, $fn=RESOLUTION);
2017-12-21 15:21:30 +00:00
// middle squares
translate([0, outer_size-inner_size, 0])
__round_square(outer_size, inner_size-(outer_size-inner_size), 5);
//translate([outer_size-inner_size, 0, 0])
//__round_square(inner_size-(outer_size-inner_size), outer_size, 5);
2017-12-21 15:21:30 +00:00
// round edges between middle squares
/*translate([outer_size-inner_size-2.5, outer_size-inner_size-2.5, 0])
2017-12-21 15:21:30 +00:00
__radius_cutout(2.5);
translate([outer_size-(outer_size-inner_size)+2.5, outer_size-inner_size-2.5, 0])
rotate([0, 0, 90])
__radius_cutout(2.5);
translate([outer_size-(outer_size-inner_size)+2.5, outer_size-(outer_size-inner_size)+2.5, 0])
rotate([0, 0, 180])
__radius_cutout(2.5);
translate([outer_size-inner_size-2.5, outer_size-(outer_size-inner_size)+2.5, 0])
rotate([0, 0, 270])
__radius_cutout(2.5);
*/
2017-12-21 16:47:45 +00:00
}
module __mainboard_bearings(mainboard_width, mainboard_height) {
// measured from a microATX (970M Pro3):
// * mainboard_width=230;
// * mainboard_height=244;
bearing_size=4;
// bottom row
translate([0, 5]) {
// inofficial hole added by ASROCK (970M Pro3)
// translate([5, 0])
// circle(d=bearing_size, $fn=RESOLUTION);
translate([63, 0])
circle(d=bearing_size, $fn=RESOLUTION);
translate([195, 0])
circle(d=bearing_size, $fn=RESOLUTION);
}
// middle row
translate([0, mainboard_height-80]) {
translate([63, 0])
circle(d=bearing_size, $fn=RESOLUTION);
translate([mainboard_width-10, 0])
circle(d=bearing_size, $fn=RESOLUTION);
}
// middle top row
translate([63, mainboard_height-14])
circle(d=bearing_size, $fn=RESOLUTION);
// nearly top left hole
translate([mainboard_width-10, mainboard_height-34])
circle(d=bearing_size, $fn=RESOLUTION);
// top left hole
// inofficial hole added by ASROCK (970M Pro3)
// translate([5, mainboard_height-5])
// circle(d=bearing_size, $fn=RESOLUTION);
2018-02-15 22:50:26 +00:00
}
module __35_hdd_bearings(bearing_size) {
// side bearings on 3.5" disks are at 0, 60mm and 102mm (SIC!) each, 15mm shifted
// 3.5" width is 100mm adding +10mm on each side for the clamps/holder
// bottom screw row @0mm (+15mm shift)
translate([0, 15]) {
translate([-5, 0])
circle(d=bearing_size);
translate([ 105, 0])
circle(d=bearing_size);
}
// mid screw row @60mm (+15mm shift)
translate([0, 75]) {
translate([-5, 0])
circle(d=bearing_size);
translate([ 105, 0])
circle(d=bearing_size);
}
// top screw row @102mm (+15mm shift)
translate([0, 117]) {
translate([-5, 0])
circle(d=bearing_size);
translate([ 105, 0])
circle(d=bearing_size);
}
// 3.5" HDD dummy
// square([100, 145]);
// cable slots
translate([10, 145])
__round_square(80, 10, 5);
2017-12-20 18:31:41 +00:00
}