This commit is contained in:
zhao
2022-12-31 13:56:54 -05:00
parent d81b129686
commit d0c89d13c6
40 changed files with 586 additions and 388 deletions

View File

@ -1,5 +1,5 @@
include <../common.scad>
include <./screws.scad>
include <../../common.scad>
include <../screws.scad>
$fn=64;

View File

@ -1,5 +1,5 @@
include <../common.scad>
include <./screws.scad>
include <../../common.scad>
include <../screws.scad>
//slack = 0.5;

View File

@ -1,19 +1,88 @@
sideHeight = 210;
sideLength = 200;
include <../../../misc/magnet.scad>
include <../../../math.scad>
$fn=64;
_height = 210;
_depth = 200;
_thickness = 5;
holeOffset = 10;
module _base() {
difference() {
cube(size = [_height, _depth, _thickness], center=true);
union() {
translate(v = [0, 0, 20])
minkowski() {
sphere(r = 20);
cube(size = [_height - 34, _depth - 34, 1], center = true);
// TODO make helper function for this
screwDiffs = [
[sideLength-holeOffset, sideHeight-holeOffset,0],
[holeOffset, holeOffset,0],
[sideLength-holeOffset, holeOffset],
[holeOffset, sideHeight-holeOffset],
}
// handles
handleLength = 80;
translate(v=[0, _depth/2, _thickness+5.5])
minkowski() {
sphere(r=10);
cube(size=[handleLength, 10, 1], center=true);
}
translate(v=[0, -_depth/2, _thickness+5.5])
minkowski() {
sphere(r=10);
cube(size=[handleLength, 10, 1], center=true);
}
}
}
}
module magnetMount(h) {
slack = 0.2;
difference() {
cylinder(h = h, r=magnetR*2);
translate(v=[0,0,h-magnetH])
cylinder(h = magnetH, r = magnetR+slack);
}
}
module side() {
magnetMountOffsetX = 95;
magnetMountOffsetY = 90;
difference() {
union() {
// align _base to positive z plan
translate(v = [0, 0, _thickness / 2])
_base();
// magnet mounts (no holes)
for (i=mirror4XY(midpoint=[0,0,0], offsetX=magnetMountOffsetX, offsetY=magnetMountOffsetY)) {
translate(v=i)
cylinder(h=_thickness, r=2*magnetR);
}
}
// magnet mount holes
for (i=mirror4XY(midpoint=[0,0,_thickness-magnetH], offsetX=magnetMountOffsetX, offsetY=magnetMountOffsetY)) {
translate(v=i)
cylinder(h=magnetH, r=magnetR);
}
}
}
difference() {
side();
union() {
for (i=[0:7]) {
translate(v=[i*15 - 52.5,0,0])
minkowski() {
cube(size = [2, 100, 10], center = true);
sphere(r=2);
}
}
}
}
[sideLength-2*holeOffset, sideHeight-holeOffset,0],
[2*holeOffset, holeOffset,0],
[sideLength-2*holeOffset, holeOffset],
[2*holeOffset, sideHeight-holeOffset]
];

Binary file not shown.

View File

@ -1,79 +1,97 @@
include <../common.scad>
include <./screws.scad>
include <../../common.scad>
include <../../math.scad>
include <../screws.scad>
$fn=64;
module baseFrame() {
difference() {
cube(size=[200,200,4], center=true);
cube(size=[180,180,4], center=true);
}
translate(v=[80,80,0])
cube(size=[20,20, 4],center=true);
translate(v=[-80,80,0])
cube(size=[20,20, 4],center=true);
translate(v=[80,-80,0])
cube(size=[20,20, 4],center=true);
translate(v=[-80,-80,0])
cube(size=[20,20, 4],center=true);
}
module lugBottom() {
difference() {
cube(size=[9.7,9.7,6], center=true);
translate(v=[2,2,0])
cube(size=[9.1,9.1,5+1], center=true);
}
}
_height = 8;
_width = 210;
_depth = 200;
module base() {
module _bodySilBase(width, depth, height, roundedPartHeight) {
hull() {
cube(size = [width, depth, height - roundedPartHeight]);
minkowski() {
translate(v = [roundedPartHeight, 0, height - roundedPartHeight])
cube(size = [width-2*roundedPartHeight, depth, eps]);
difference() {
union() {
translate(v=[0,0,4/2])
baseFrame();
translate(v=[-90,-90,-6/2])
lugBottom();
mirror(v=[1,0,0])
translate(v=[-90,-90,-6/2])
lugBottom();
mirror(v=[0,1,0])
translate(v=[-90,-90,-6/2])
lugBottom();
mirror(v=[1,1,0])
translate(v=[-90,-90,-6/2])
lugBottom();
}
union() {
translate(v=[80,80,0])
cylinder(h = 100, r = m3ptr, $fn=32, center=true);
translate(v=[-80,80,0])
cylinder(h = 100, r = m3ptr, $fn=32, center=true);
translate(v=[80,-80,0])
cylinder(h = 100, r = m3ptr, $fn=32, center=true);
translate(v=[-80,-80,0])
cylinder(h = 100, r = m3ptr, $fn=32, center=true);
rotate(a = [90, 0, 0])
cylinder(r = roundedPartHeight, h = eps);
}
}
}
base();
module _bodySil(width, depth, height, roundedPartHeight, wallThickness, topThickness) {
cornerSquareDim = 30;
difference() {
_bodySilBase(width, depth, height, roundedPartHeight);
union() {
translate(v = [wallThickness, cornerSquareDim, - topThickness])
_bodySilBase(width - 2 * wallThickness, depth - 2 * cornerSquareDim, height, roundedPartHeight);
translate(v=[cornerSquareDim, wallThickness, -topThickness])
cube(size=[width-2*cornerSquareDim, depth-2*wallThickness, height]);
}
}
}
// Negative and centered on xy. Aligned with z=0 downwards
module _lugAndMagnet() {
slack = 0.3;
vSlack = 0.1;
// lug
translate(v=[0,0,-2.5])
cube(size=[10+slack, 10+slack, 5+vSlack], center=true);
// hole for magnet, no tolerance on
translate(v=[0,0,-(5+vSlack+1.7)])
cylinder(d=6+slack, h=1.7+vSlack);
}
module baseBody() {
difference() {
_bodySil(_width, _depth, _height, 4, 5, 2);
_mid = [_width / 2, _depth / 2, _height];
union() {
for (i = mirror4XY(midpoint = _mid, offsetX = (_width / 2) - 15, offsetY = (_depth / 2) - 10)) {
translate(v = i)
_lugAndMagnet();
}
screwHolePositions = concat(
mirror4XY(midpoint = _mid, offsetX = (_width / 2) - 25, offsetY = (_depth / 2) - 20),
mirror4XY(midpoint = _mid, offsetX = (_width / 2) - 15, offsetY = (_depth / 2) - 20),
mirror4XY(midpoint = _mid, offsetX = (_width / 2) - 25, offsetY = (_depth / 2) - 10)
);
for (i = screwHolePositions) {
translate(v = i) {
cylinder(r = m3RadiusSlacked, h = inf, center = true);
}
}
}
}
}
difference() {
baseBody();
union() {
minkowski() {
translate(v = [(_width - 130) / 2, (_depth - 150) / 2, - inf / 2])
cube(size = [130, 150, inf]);
cylinder(r = 5);
}
}
}

BIN
cases/rack/body/top1.stl Normal file

Binary file not shown.

View File

@ -298,7 +298,7 @@ module frontPlateAligned() {
frontPlate();
union() {
// lugs
// lugs TODO not recessed enough!!
translate(v=[-0.05,-(1.5+boxFrontThickness),-0.05])
cube(size=[4+0.1,2,4+0.1]);