add test tool
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
|
include <./slack.scad>
|
||||||
|
|
||||||
// Dimensions for small cylindrical neodymium magnets that I bought off Amazon
|
// Dimensions for small cylindrical neodymium magnets that I bought off Amazon
|
||||||
magnetR = 3;
|
magnetR = 3;
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
include <./profiles.scad>
|
include <./profiles.scad>
|
||||||
|
|
||||||
profileName = "micro";
|
profileName = "default";
|
||||||
profile = getProfile(profileName);
|
profile = getProfile(profileName);
|
||||||
|
|
||||||
// echo("Profile:", profile);
|
// echo("Profile:", profile);
|
||||||
|
|||||||
@ -32,15 +32,18 @@ module sideWallBase() {
|
|||||||
translate(v = [r, r, 0])
|
translate(v = [r, r, 0])
|
||||||
minkowski() {
|
minkowski() {
|
||||||
cube(size = [x-r, y-2*r, z]);
|
cube(size = [x-r, y-2*r, z]);
|
||||||
|
|
||||||
|
if (r > 0) {
|
||||||
sphere(r = r);
|
sphere(r = r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
intersection() {
|
intersection() {
|
||||||
difference() {
|
difference() {
|
||||||
sideWallShellHelper(sideWallX, sideWallY, sideWallZ, baseRoundness);
|
sideWallShellHelper(sideWallX, sideWallY, sideWallZ, baseRoundness);
|
||||||
translate(v = [sideWallThickness, sideWallThickness, 0])
|
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 = [-1, 0, 0], p = [sideWallX, 0, 0]);
|
||||||
halfspace(vpos = [0, 0, -1], p = [0, 0, sideWallZ]);
|
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;
|
ribRampLength = 5;
|
||||||
|
ribWidth = 2;
|
||||||
|
|
||||||
intersection() {
|
intersection() {
|
||||||
for (i = [0:numRibs-1]) {
|
for (i = [0:numRibs-1]) {
|
||||||
|
|
||||||
translate(v = [sideWallThickness, i*ribYDiff, (sideWallZ-ribZ)/2])
|
translate(v = [sideWallThickness, i*ribYDiff, (sideWallZ-ribZ)/2])
|
||||||
translate(v = [ribExtrusion-ribR, 0, 0])
|
translate(v = [ribExtrusion-ribWidth, 0, 0])
|
||||||
verticalRib(ribExtend=4, ribWidth=2);
|
verticalRib(ribExtend=4, ribWidth=ribWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
halfspace(vpos=[1,0,0], p=[0,0,0]);
|
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) {
|
module verticalRib(ribExtend, ribWidth) {
|
||||||
|
|
||||||
|
roundness = 0.5;
|
||||||
|
|
||||||
minkowski() {
|
minkowski() {
|
||||||
hull() {
|
hull() {
|
||||||
|
translate(v=[0,0,roundness])
|
||||||
cube(size = [eps, ribWidth, eps]);
|
cube(size = [eps, ribWidth, eps]);
|
||||||
|
|
||||||
translate(v = [0, 0, ribRampLength])
|
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]);
|
cube(size = [eps, ribWidth, eps]);
|
||||||
}
|
}
|
||||||
|
|
||||||
sphere(r=0.5);
|
sphere(r=roundness);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,10 +30,10 @@ module sideWallLeft() {
|
|||||||
apply_p() {
|
apply_p() {
|
||||||
union() {
|
union() {
|
||||||
translate(v = [0, 82, 0])
|
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])
|
translate(v = [0, 18, 0])
|
||||||
sideWallVerticalRibs(numRibs = 3, ribZ = sideWallZ-20, ribYDiff = 8, ribR = 3, ribExtrusion = 1.5);
|
sideWallVerticalRibs(numRibs = 2, ribZ = sideWallZ, ribYDiff = 8, ribExtrusion = 1.5);
|
||||||
}
|
}
|
||||||
children(0);
|
children(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -33,10 +33,10 @@ module sideWallRight() {
|
|||||||
apply_p() {
|
apply_p() {
|
||||||
union() {
|
union() {
|
||||||
translate(v = [0, 82, 0])
|
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])
|
translate(v = [0, 18, 0])
|
||||||
sideWallVerticalRibs(numRibs = 3, ribZ = sideWallZ-20, ribYDiff = 8, ribR = 3, ribExtrusion = 1.5);
|
sideWallVerticalRibs(numRibs = 2, ribZ = sideWallZ, ribYDiff = 8, ribExtrusion = 1.5);
|
||||||
}
|
}
|
||||||
children(0);
|
children(0);
|
||||||
}
|
}
|
||||||
|
|||||||
41
tool/magnetPolarityReference.scad
Normal file
41
tool/magnetPolarityReference.scad
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user