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,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);
}
}
}