dummy edit with openscad that prbably changed all line endings

This commit is contained in:
douzeb 2023-01-26 08:29:10 +01:00
parent f98e5d74d1
commit a84ccfa59e

View file

@ -1,377 +1,376 @@
// v2 // v2
// Reduced rail width from 2 to 1.7 // Reduced rail width from 2 to 1.7
// Adjust ethernet and micro-usb // Adjust ethernet and micro-usb
// Ease assembly // Ease assembly
$w=1.5; // wall thickness $w=1.5; // wall thickness
$g=.2; // gap $g=.2; // gap
$hl=123; // heatsink length $hl=123; // heatsink length
$hw=100; // heatsink width $hw=100; // heatsink width
$hrailh=1.7 - $g; // heatsink rail height $hrailh=1.7 - $g; // heatsink rail height
$hrailw=1.7 - $g; // heatsink rail witdth $hrailw=1.7 - $g; // heatsink rail witdth
$boxh=40.5; // box height $boxh=40.5; // box height
$boxw=$hw + 2 * ($w + $g); // box width $boxw=$hw + 2 * ($w + $g); // box width
$boxl=$hl / 2 + ($w + $g); // box length $boxl=$hl / 2 + ($w + $g); // box length
$feeth=5.3; // feet height $feeth=5.3; // feet height
// ======================================== // ========================================
translate([0, 0, 0]) frontBox(); translate([0, 0, 0]) frontBox();
translate([0, 0, 0]) rotate([0, 0, 180]) color("orange") backBox(); translate([0, 0, 0]) rotate([0, 0, 180]) color("orange") backBox();
// ================ MODULES ================ // ================ MODULES ================
module frontBox() { module frontBox() {
difference() { difference() {
union() { union() {
box(); box();
color("red") hdd(); color("red") hdd();
} }
frontHoles(); frontHoles();
frontScrewoles(); frontScrewoles();
frontLabel(); frontLabel();
} }
} }
module backBox() { module backBox() {
difference() { difference() {
union() { union() {
box(); box();
connectors(); connectors();
} }
backHoles(); backHoles();
backScrewoles(); backScrewoles();
} }
} }
module frontLabel() { module frontLabel() {
color("green") color("green")
translate([$boxw / 2 - 6, $boxl - .5, $feeth + 5]) translate([$boxw / 2 - 6, $boxl - .5, $feeth + 5])
rotate([90, 0, 180]) rotate([90, 0, 180])
linear_extrude(2) text("Odroid M1", size=4); linear_extrude(2) text("Odroid M1", size=4);
} }
module frontScrewoles() { module frontScrewoles() {
translate([0, 4.2, $feeth + $boxh - 25.3]) translate([0, 4.2, $feeth + $boxh - 25.3])
rotate([0, 90, 0]) rotate([0, 90, 0])
cylinder(h=$boxw + 10, r=1.1, center=true, $fn=20); cylinder(h=$boxw + 10, r=1.1, center=true, $fn=20);
translate([37, 4.2, 0]) translate([37, 4.2, 0])
rotate([0, 0, 90]) rotate([0, 0, 90])
cylinder(h=50, r=1.1, center=true, $fn=20); cylinder(h=50, r=1.1, center=true, $fn=20);
translate([-37, 4.2, 0]) translate([-37, 4.2, 0])
rotate([0, 0, 90]) rotate([0, 0, 90])
cylinder(h=50, r=1.1, center=true, $fn=20); cylinder(h=50, r=1.1, center=true, $fn=20);
} }
module backScrewoles() { module backScrewoles() {
translate([0, -4.2, $feeth + $boxh - 25.3]) translate([0, -4.2, $feeth + $boxh - 25.3])
rotate([0, 90, 0]) rotate([0, 90, 0])
cylinder(h=$boxw + 10, r=0.8, center=true, $fn=20); cylinder(h=$boxw + 10, r=0.8, center=true, $fn=20);
translate([37, -4.2, 0]) translate([37, -4.2, 0])
rotate([0, 0, 90]) rotate([0, 0, 90])
cylinder(h=50, r=0.8, center=true, $fn=20); cylinder(h=50, r=0.8, center=true, $fn=20);
translate([-37, -4.2, 0]) translate([-37, -4.2, 0])
rotate([0, 0, 90]) rotate([0, 0, 90])
cylinder(h=50, r=0.8, center=true, $fn=20); cylinder(h=50, r=0.8, center=true, $fn=20);
} }
module connectors() { module connectors() {
difference() { difference() {
union() { union() {
connector($boxw - 2 * $w); connector($boxw - 2 * $w);
translate([-$boxw / 2, 0, $feeth + $w + 12.55]) translate([-$boxw / 2, 0, $feeth + $w + 12.55])
rotate([0, 90, 0]) rotate([0, 90, 0])
connector(25, 0); connector(25, 0);
translate([$boxw / 2, 0, $feeth + $w + 12.55]) translate([$boxw / 2, 0, $feeth + $w + 12.55])
rotate([0, -90, 0]) rotate([0, -90, 0])
connector(25, 0); connector(25, 0);
} }
translate([$boxw / 2 - .5 * $w, -5, $feeth + $w]) translate([$boxw / 2 - .5 * $w, -5, $feeth + $w])
rotate([0, -45, 0]) rotate([0, -45, 0])
cube([10, 10, 2 * $w], center=true); cube([10, 10, 2 * $w], center=true);
translate([-($boxw / 2 - .5 * $w), -5, $feeth + $w]) translate([-($boxw / 2 - .5 * $w), -5, $feeth + $w])
rotate([0, 45, 0]) rotate([0, 45, 0])
cube([10, 10, 2 * $w], center=true); cube([10, 10, 2 * $w], center=true);
translate([-($boxw / 2 - .5 * $w), -7.7, $feeth + $w]) translate([-($boxw / 2 - .5 * $w), -7.7, $feeth + $w])
rotate([0, 45, 45]) rotate([0, 45, 45])
cube([10, 10, 2 * $w], center=true); cube([10, 10, 2 * $w], center=true);
translate([$boxw / 2 - .5 * $w, -7.7, $feeth + $w]) translate([$boxw / 2 - .5 * $w, -7.7, $feeth + $w])
rotate([0, -45, -45]) rotate([0, -45, -45])
cube([10, 10, 2 * $w], center=true); cube([10, 10, 2 * $w], center=true);
} }
} }
module connector($width, $z = $feeth) { module connector($width, $z = $feeth) {
difference() { difference() {
union() { union() {
translate([0, 0, $z + 1.5 * $w]) translate([0, 0, $z + 1.5 * $w])
cube([$width, 18, $w], center=true); cube([$width, 18, $w], center=true);
translate([0, 4.5, $z + $w]) translate([0, 4.5, $z + $w])
cube([$width, 9, $w], center=true); cube([$width, 9, $w], center=true);
} }
// translate([0, -9.3, $z + 1.5 * $w]) // translate([0, -9.3, $z + 1.5 * $w])
// rotate([45, 0, 0]) // rotate([45, 0, 0])
// cube([$width + $g, 18, $w], center=true); // cube([$width + $g, 18, $w], center=true);
translate([0, 9.3, $z + 1.5 * $w]) translate([0, 9.3, $z + 1.5 * $w])
rotate([-45, 0, 0]) rotate([-45, 0, 0])
cube([$width + $g, 18, $w], center=true); cube([$width + $g, 18, $w], center=true);
translate([0, -9.3, $z + 1.5 * $w]) translate([0, -9.3, $z + 1.5 * $w])
rotate([-45, 0, 0]) rotate([-45, 0, 0])
cube([$width + $g, 18, $w], center=true); cube([$width + $g, 18, $w], center=true);
} }
} }
module backHoles() { module backHoles() {
color("green") { color("green") {
translate([0, $boxl, $feeth + $boxh - 13.8]) translate([0, $boxl, $feeth + $boxh - 13.8])
corners(24.26, 92); corners(24.26, 92);
translate([31.9, $boxl, $boxh - 9.92]) translate([31.9, $boxl, $boxh - 9.92])
cube([12.8, 5, 3.1], center=true); cube([12.8, 5, 3.1], center=true);
translate([19, $boxl, $feeth + $boxh - 13.8]) translate([19, $boxl, $feeth + $boxh - 13.8])
rotate([90, 0, 0]) rotate([90, 0, 0])
cylinder(h=5, r=3, center=true, $fn=100); cylinder(h=5, r=3, center=true, $fn=100);
translate([-32.33, $boxl, $feeth + $boxh - 9.4]) translate([-32.33, $boxl, $feeth + $boxh - 9.4])
rotate([90, 0, 0]) rotate([90, 0, 0])
cylinder(h=5, r=2.85, center=true, $fn=100); cylinder(h=5, r=2.85, center=true, $fn=100);
} }
} }
module frontHoles() { module frontHoles() {
color("green") { color("green") {
translate([0, $boxl, $feeth + $boxh - 13.8]) translate([0, $boxl, $feeth + $boxh - 13.8])
corners(24.26, 92); corners(24.26, 92);
// ethernet // ethernet
translate([34.42, $boxl, $feeth + $boxh - 14]) translate([34.42, $boxl, $feeth + $boxh - 14])
cube([15.32, 5, 13.5], center=true); cube([15.32, 5, 13.5], center=true);
// usb // usb
translate([-2.87, $boxl, $feeth + $boxh - 15.5]) translate([-2.87, $boxl, $feeth + $boxh - 15.5])
cube([14.5, 5, 16], center=true); cube([14.5, 5, 16], center=true);
translate([-21, $boxl, $feeth + $boxh - 15.5]) translate([-21, $boxl, $feeth + $boxh - 15.5])
cube([14.5, 5, 16], center=true); cube([14.5, 5, 16], center=true);
// power // power
translate([-38.8, $boxl, $feeth + $boxh - 14.07]) translate([-38.8, $boxl, $feeth + $boxh - 14.07])
rotate([90, 0, 0]) rotate([90, 0, 0])
cylinder(h=5, r=3.725, center=true, $fn=100); cylinder(h=5, r=3.725, center=true, $fn=100);
// hdmi // hdmi
translate([17.13, $boxl, $feeth + $boxh - 10.8]) { translate([17.13, $boxl, $feeth + $boxh - 10.8]) {
difference() { difference() {
cube([15.35, 5, 6], center=true); cube([15.35, 5, 6], center=true);
translate([-10, 0, 3]) translate([-10, 0, 3])
rotate([0, 45, 0]) rotate([0, 45, 0])
cube([6, 6, 6], center=true); cube([6, 6, 6], center=true);
translate([10, 0, 3]) translate([10, 0, 3])
rotate([0, -45, 0]) rotate([0, -45, 0])
cube([6, 6, 6], center=true); cube([6, 6, 6], center=true);
} }
} }
// micro-usb // micro-usb
translate([-21.21, $boxl, $feeth + $boxh - 4.3]) translate([-21.21, $boxl, $feeth + $boxh - 4.3])
difference() { difference() {
cube([8, 5, 3], center=true); cube([8, 5, 3], center=true);
translate([-5, 0, -1.5]) translate([-5, 0, -1.5])
rotate([0, -45, 0]) rotate([0, -45, 0])
cube([3, 6, 3], center=true); cube([3, 6, 3], center=true);
translate([5, 0, -1.5]) translate([5, 0, -1.5])
rotate([0, 45, 0]) rotate([0, 45, 0])
cube([3, 6, 3], center=true); cube([3, 6, 3], center=true);
} }
translate([-39, $boxl - 3.5, $feeth + $boxh - 13.3]) translate([-39, $boxl - 3.5, $feeth + $boxh - 13.3])
cube([11, 5, 13], center=true); cube([11, 5, 13], center=true);
translate([16.8, $boxl - 3.5, $feeth + $boxh - 11]) translate([16.8, $boxl - 3.5, $feeth + $boxh - 11])
cube([19, 5, 10], center=true); cube([19, 5, 10], center=true);
} }
} }
module corners($height = 0, $width = 0) { module corners($height = 0, $width = 0) {
$r = 4; $r = 4;
$h = $height - $r * 2; $h = $height - $r * 2;
$w = $width - $r * 2; $w = $width - $r * 2;
rotate([0, 90, 90]) rotate([0, 90, 90])
union() { union() {
translate([-$h / 2, -$w / 2, 0]) translate([-$h / 2, -$w / 2, 0])
difference() { difference() {
cylinder(h=1, r=$r, center=true, $fn=100); cylinder(h=1, r=$r, center=true, $fn=100);
cylinder(h=2, r=$r - 1, center=true, $fn=100); cylinder(h=2, r=$r - 1, center=true, $fn=100);
translate([0, 5, 0]) translate([0, 5, 0])
cube([20, 10, 2], center=true); cube([20, 10, 2], center=true);
translate([5, 0, 0]) translate([5, 0, 0])
cube([10, 20, 2], center=true); cube([10, 20, 2], center=true);
} }
translate([-$h / 2, $w / 2, 0]) translate([-$h / 2, $w / 2, 0])
difference() { difference() {
cylinder(h=1, r=$r, center=true, $fn=100); cylinder(h=1, r=$r, center=true, $fn=100);
cylinder(h=2, r=$r - 1, center=true, $fn=100); cylinder(h=2, r=$r - 1, center=true, $fn=100);
translate([0, -5, 0]) translate([0, -5, 0])
cube([20, 10, 2], center=true); cube([20, 10, 2], center=true);
translate([5, 0, 0]) translate([5, 0, 0])
cube([10, 20, 2], center=true); cube([10, 20, 2], center=true);
} }
translate([$h / 2, -$w / 2, 0]) translate([$h / 2, -$w / 2, 0])
difference() { difference() {
cylinder(h=1, r=$r, center=true, $fn=100); cylinder(h=1, r=$r, center=true, $fn=100);
cylinder(h=2, r=$r - 1, center=true, $fn=100); cylinder(h=2, r=$r - 1, center=true, $fn=100);
translate([0, 5, 0]) translate([0, 5, 0])
cube([20, 10, 2], center=true); cube([20, 10, 2], center=true);
translate([-5, 0, 0]) translate([-5, 0, 0])
cube([10, 20, 2], center=true); cube([10, 20, 2], center=true);
} }
translate([$h / 2, $w / 2, 0]) translate([$h / 2, $w / 2, 0])
difference() { difference() {
cylinder(h=1, r=$r, center=true, $fn=100); cylinder(h=1, r=$r, center=true, $fn=100);
cylinder(h=2, r=$r - 1, center=true, $fn=100); cylinder(h=2, r=$r - 1, center=true, $fn=100);
translate([0, -5, 0]) translate([0, -5, 0])
cube([20, 10, 2], center=true); cube([20, 10, 2], center=true);
translate([-5, 0, 0]) translate([-5, 0, 0])
cube([10, 20, 2], center=true); cube([10, 20, 2], center=true);
} }
translate([$h / 2 + $r - .5, 0, 0]) translate([$h / 2 + $r - .5, 0, 0])
cube([1, $w + .02, 1], center=true); cube([1, $w + .02, 1], center=true);
translate([-($h / 2 + $r - .5), 0, 0]) translate([-($h / 2 + $r - .5), 0, 0])
cube([1, $w + .02, 1], center=true); cube([1, $w + .02, 1], center=true);
translate([0, $w / 2 + $r - .5, 0]) translate([0, $w / 2 + $r - .5, 0])
cube([$h + .02, 1, 1], center=true); cube([$h + .02, 1, 1], center=true);
translate([0, -($w / 2 + $r - .5), 0]) translate([0, -($w / 2 + $r - .5), 0])
cube([$h + .02, 1, 1], center=true); cube([$h + .02, 1, 1], center=true);
} }
} }
module hdd() { module hdd() {
// vertical // vertical
translate([37, $boxl / 2 + ($boxl - 53 - $w) / 2, $feeth + 7]) translate([37, $boxl / 2 + ($boxl - 53 - $w) / 2, $feeth + 7])
cube([$w, 53, 13], center=true); cube([$w, 53, 13], center=true);
difference() { difference() {
// horizontal // horizontal
translate([$boxw / 2 - 12.5 - $w / 2, $boxl / 2 + ($boxl - 53 - $w) / 2, $feeth + 13]) translate([$boxw / 2 - 12.5 - $w / 2, $boxl / 2 + ($boxl - 53 - $w) / 2, $feeth + 13])
cube([25, 53, $w], center=true); cube([25, 53, $w], center=true);
// screw hole // screw hole
translate([61.72 / 2, $boxl - $w - 10, $feeth + 13.7]) translate([61.72 / 2, $boxl - $w - 10, $feeth + 13.7])
cylinder(h=10, r=1.85, center=true, $fn=20); cylinder(h=10, r=1.85, center=true, $fn=20);
} }
// vertical // vertical
translate([-37, $boxl / 2 + ($boxl - 53 - $w) / 2, $feeth + 7]) translate([-37, $boxl / 2 + ($boxl - 53 - $w) / 2, $feeth + 7])
cube([$w, 53, 13], center=true); cube([$w, 53, 13], center=true);
difference() { difference() {
// horizontal // horizontal
translate([-($boxw / 2 - 12.5 - $w / 2), $boxl / 2 + ($boxl - 53 - $w) / 2, $feeth + 13]) translate([-($boxw / 2 - 12.5 - $w / 2), $boxl / 2 + ($boxl - 53 - $w) / 2, $feeth + 13])
cube([25, 53, $w], center=true); cube([25, 53, $w], center=true);
// screw hole // screw hole
translate([-61.72 / 2, $boxl - $w - 10, $feeth + 13.7]) translate([-61.72 / 2, $boxl - $w - 10, $feeth + 13.7])
cylinder(h=10, r=1.85, center=true, $fn=20); cylinder(h=10, r=1.85, center=true, $fn=20);
} }
} }
module box() { module box() {
union() { union() {
walls(); walls();
rails(); rails();
feet(); feet();
} }
} }
module walls() { module walls() {
difference() { difference() {
union() { union() {
// front wall // front wall
translate([0, $boxl - $w / 2, $feeth + $boxh / 2]) translate([0, $boxl - $w / 2, $feeth + $boxh / 2])
cube([$boxw, $w, $boxh], center=true); cube([$boxw, $w, $boxh], center=true);
// left wall // left wall
translate([($boxw - $w) / 2, $boxl / 2, $feeth + $boxh / 2]) translate([($boxw - $w) / 2, $boxl / 2, $feeth + $boxh / 2])
cube([$w, $boxl, $boxh], center=true); cube([$w, $boxl, $boxh], center=true);
// right wall // right wall
translate([-($boxw - $w) / 2, $boxl / 2, $feeth + $boxh / 2]) translate([-($boxw - $w) / 2, $boxl / 2, $feeth + $boxh / 2])
cube([$w, $boxl, $boxh], center=true); cube([$w, $boxl, $boxh], center=true);
} }
// corners cuts // corners cuts
translate([($boxw - $w) / 2 + 5, $boxl / 2, $feeth + 41.1]) translate([($boxw - $w) / 2 + 5, $boxl / 2, $feeth + 41.1])
rotate([0,45,0]) rotate([0,45,0])
cube([20, $boxl + 10, 15],center=true); cube([20, $boxl + 10, 15],center=true);
translate([-(($boxw - $w) / 2 + 5), $boxl / 2, $feeth + 41.1]) translate([-(($boxw - $w) / 2 + 5), $boxl / 2, $feeth + 41.1])
rotate([0,-45,0]) rotate([0,-45,0])
cube([20, $boxl + 10, 15],center=true); cube([20, $boxl + 10, 15],center=true);
} }
// bottom wall // bottom wall
difference() { difference() {
translate([0, $boxl / 2, $feeth + $w / 2]) translate([0, $boxl / 2, $feeth + $w / 2])
cube([$boxw, $boxl, $w], center=true); cube([$boxw, $boxl, $w], center=true);
// bottom cuts // bottom cuts
translate([0, $boxl / 2, $feeth + $w / 2]) translate([0, $boxl / 2, $feeth + $w / 2])
cube([3, 40, $w * 2], center=true); cube([3, 40, $w * 2], center=true);
translate([10, $boxl / 2, $feeth + $w / 2]) translate([10, $boxl / 2, $feeth + $w / 2])
cube([3, 40, $w * 2], center=true); cube([3, 40, $w * 2], center=true);
translate([-10, $boxl / 2, $feeth + $w / 2]) translate([-10, $boxl / 2, $feeth + $w / 2])
cube([3, 40, $w * 2], center=true); cube([3, 40, $w * 2], center=true);
translate([20, $boxl / 2, $feeth + $w / 2]) translate([20, $boxl / 2, $feeth + $w / 2])
cube([3, 40, $w * 2], center=true); cube([3, 40, $w * 2], center=true);
translate([-20, $boxl / 2, $feeth + $w / 2]) translate([-20, $boxl / 2, $feeth + $w / 2])
cube([3, 40, $w * 2], center=true); cube([3, 40, $w * 2], center=true);
translate([30, $boxl / 2, $feeth + $w / 2]) translate([30, $boxl / 2, $feeth + $w / 2])
cube([3, 40, $w * 2], center=true); cube([3, 40, $w * 2], center=true);
translate([-30, $boxl / 2, $feeth + $w / 2]) translate([-30, $boxl / 2, $feeth + $w / 2])
cube([3, 40, $w * 2], center=true); cube([3, 40, $w * 2], center=true);
} }
} }
module rails() { module rails() {
translate([($boxw / 2 - $w) - ($hrailw - $w / 2) / 2, $boxl / 2, $feeth + 33.8]) translate([($boxw / 2 - $w) - ($hrailw - $w / 2) / 2, $boxl / 2, $feeth + 33.8])
cube([$hrailw + $w / 2, $boxl - $w, $hrailh], center=true); cube([$hrailw + $w / 2, $boxl - $w, $hrailh], center=true);
translate([-(($boxw / 2 - $w) - ($hrailw - $w / 2) / 2), $boxl / 2, $feeth + 33.8]) translate([-(($boxw / 2 - $w) - ($hrailw - $w / 2) / 2), $boxl / 2, $feeth + 33.8])
cube([$hrailw + $w / 2, $boxl - $w, $hrailh], center=true); cube([$hrailw + $w / 2, $boxl - $w, $hrailh], center=true);
} }
module feet() { module feet() {
$f = $feeth + $w / 2; $f = $feeth + $w / 2;
difference() { difference() {
translate([($boxw - $f * 2) / 2, $boxl - $w / 2, $f / 2]) translate([($boxw - $f * 2) / 2, $boxl - $w / 2, $f / 2])
cube([$f * 2, $w, $f], center=true); cube([$f * 2, $w, $f], center=true);
translate([($boxw - $f) / 2 - 1.5 * $f, $boxl - $w / 2, 0]) translate([($boxw - $f) / 2 - 1.5 * $f, $boxl - $w / 2, 0])
rotate([0, 45, 0]) rotate([0, 45, 0])
cube([$f * 2, $w * 2, $f * 2], center=true); cube([$f * 2, $w * 2, $f * 2], center=true);
} }
difference() { difference() {
translate([-($boxw - $f * 2) / 2, $boxl - $w / 2, $f / 2]) translate([-($boxw - $f * 2) / 2, $boxl - $w / 2, $f / 2])
cube([$f * 2, $w, $f], center=true); cube([$f * 2, $w, $f], center=true);
translate([-($boxw - $f) / 2 + 1.5 * $f, $boxl - $w / 2, 0]) translate([-($boxw - $f) / 2 + 1.5 * $f, $boxl - $w / 2, 0])
rotate([0, 45, 0]) rotate([0, 45, 0])
cube([$f * 2, $w * 2, $f * 2], center=true); cube([$f * 2, $w * 2, $f * 2], center=true);
} }
difference() { difference() {
translate([-($boxw - $w) / 2, $boxl - $f, $f / 2]) translate([-($boxw - $w) / 2, $boxl - $f, $f / 2])
cube([$w, $f * 2, $f], center=true); cube([$w, $f * 2, $f], center=true);
translate([-($boxw - $w) / 2, $boxl - $f / 2 - 1.5 * $f, 0]) translate([-($boxw - $w) / 2, $boxl - $f / 2 - 1.5 * $f, 0])
rotate([45, 0, 0]) rotate([45, 0, 0])
cube([$w * 2, $f * 2, $f * 2], center=true); cube([$w * 2, $f * 2, $f * 2], center=true);
} }
difference() { difference() {
translate([($boxw - $w) / 2, $boxl - $f, $f / 2]) translate([($boxw - $w) / 2, $boxl - $f, $f / 2])
cube([$w, $f * 2, $f], center=true); cube([$w, $f * 2, $f], center=true);
translate([($boxw - $w) / 2, $boxl - $f / 2 - 1.5 * $f, 0]) translate([($boxw - $w) / 2, $boxl - $f / 2 - 1.5 * $f, 0])
rotate([45, 0, 0]) rotate([45, 0, 0])
cube([$w * 2, $f * 2, $f * 2], center=true); cube([$w * 2, $f * 2, $f * 2], center=true);
} }
} }