add test tool

This commit is contained in:
zhao
2023-04-10 13:44:39 -04:00
parent 16ba58e995
commit 0dcc9fcb48
6 changed files with 65 additions and 16 deletions

View File

@ -1,4 +1,4 @@
include <./slack.scad>
// Dimensions for small cylindrical neodymium magnets that I bought off Amazon
magnetR = 3;

View File

@ -8,7 +8,7 @@
*/
include <./profiles.scad>
profileName = "micro";
profileName = "default";
profile = getProfile(profileName);
// echo("Profile:", profile);

View File

@ -32,15 +32,18 @@ module sideWallBase() {
translate(v = [r, r, 0])
minkowski() {
cube(size = [x-r, y-2*r, z]);
if (r > 0) {
sphere(r = r);
}
}
}
intersection() {
difference() {
sideWallShellHelper(sideWallX, sideWallY, sideWallZ, baseRoundness);
translate(v = [sideWallThickness, sideWallThickness, 0])
sideWallShellHelper(sideWallX, sideWallY-2*sideWallThickness, sideWallZ, baseRoundness-sideWallThickness);
sideWallShellHelper(sideWallX, sideWallY-2*sideWallThickness, sideWallZ, max(0,baseRoundness-sideWallThickness));
}
halfspace(vpos = [-1, 0, 0], p = [sideWallX, 0, 0]);
halfspace(vpos = [0, 0, -1], p = [0, 0, sideWallZ]);
@ -133,16 +136,17 @@ module sideWallBase() {
}
}
module sideWallVerticalRibs(numRibs, ribZ, ribYDiff, ribR=1, ribExtrusion=1) {
module sideWallVerticalRibs(numRibs, ribZ, ribYDiff, ribExtrusion=1) {
ribRampLength = 5;
ribWidth = 2;
intersection() {
for (i = [0:numRibs-1]) {
translate(v = [sideWallThickness, i*ribYDiff, (sideWallZ-ribZ)/2])
translate(v = [ribExtrusion-ribR, 0, 0])
verticalRib(ribExtend=4, ribWidth=2);
translate(v = [ribExtrusion-ribWidth, 0, 0])
verticalRib(ribExtend=4, ribWidth=ribWidth);
}
halfspace(vpos=[1,0,0], p=[0,0,0]);
@ -150,18 +154,22 @@ module sideWallVerticalRibs(numRibs, ribZ, ribYDiff, ribR=1, ribExtrusion=1) {
module verticalRib(ribExtend, ribWidth) {
roundness = 0.5;
minkowski() {
hull() {
translate(v=[0,0,roundness])
cube(size = [eps, ribWidth, eps]);
translate(v = [0, 0, ribRampLength])
cube(size = [ribExtend, ribWidth, ribZ-2*ribRampLength]);
cube(size = [ribExtend, ribWidth, ribZ-2*(ribRampLength+roundness)]);
translate(v = [0, 0, ribZ])
translate(v = [0, 0, ribZ-roundness])
cube(size = [eps, ribWidth, eps]);
}
sphere(r=0.5);
sphere(r=roundness);
}
}

View File

@ -30,10 +30,10 @@ module sideWallLeft() {
apply_p() {
union() {
translate(v = [0, 82, 0])
sideWallVerticalRibs(numRibs = 2, ribZ = sideWallZ-20, ribYDiff = 8, ribR = 3, ribExtrusion = 1.5);
sideWallVerticalRibs(numRibs = 2, ribZ = sideWallZ, ribYDiff = 8, ribExtrusion = 1.5);
translate(v = [0, 12, 0])
sideWallVerticalRibs(numRibs = 3, ribZ = sideWallZ-20, ribYDiff = 8, ribR = 3, ribExtrusion = 1.5);
translate(v = [0, 18, 0])
sideWallVerticalRibs(numRibs = 2, ribZ = sideWallZ, ribYDiff = 8, ribExtrusion = 1.5);
}
children(0);
}

View File

@ -33,10 +33,10 @@ module sideWallRight() {
apply_p() {
union() {
translate(v = [0, 82, 0])
sideWallVerticalRibs(numRibs = 2, ribZ = sideWallZ-20, ribYDiff = 8, ribR = 3, ribExtrusion = 1.5);
sideWallVerticalRibs(numRibs = 2, ribZ = sideWallZ, ribYDiff = 8, ribExtrusion = 1.5);
translate(v = [0, 12, 0])
sideWallVerticalRibs(numRibs = 3, ribZ = sideWallZ-20, ribYDiff = 8, ribR = 3, ribExtrusion = 1.5);
translate(v = [0, 18, 0])
sideWallVerticalRibs(numRibs = 2, ribZ = sideWallZ, ribYDiff = 8, ribExtrusion = 1.5);
}
children(0);
}

View File

@ -0,0 +1,41 @@
include <../helper/common.scad>
include <../helper/magnet.scad>
doorPolarityReference();
module doorPolarityReference() {
thickness = 3;
union() {
difference() {
minkowski() {
cube(size = [50, 8, thickness]);
cylinder(r = 2, h = eps);
}
union() {
translate(v = [9, 0, 1.1])
linear_extrude(2)
text("D", font = "Liberation Sans:style=Bold", size = 8);
translate(v=[31, 0, 1.1])
linear_extrude(2)
text("M",font="Liberation Sans:style=Bold", size=8);
}
}
translate(v = [3.5, 4, thickness])
magnetHolder();
translate(v = [46.5, 4, thickness])
magnetHolder();
}
module magnetHolder() {
difference() {
cylinder(r = magnetRSlacked+2, h = magnetHSlacked, $fn = 64);
cylinder(r = magnetRSlacked, h = magnetHSlacked, $fn = 64);
}
}
}