introduce script to generate assembly animation. still needs cleanup
2
.gitignore
vendored
@ -6,3 +6,5 @@
|
||||
!/stl/mini/
|
||||
!/stl/micro/
|
||||
!/stl/nano/
|
||||
|
||||
/assembly-guide/gifs/tmp
|
||||
BIN
assembly-guide/gifs/addMagnetsToMagnetModules.gif
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
assembly-guide/gifs/addMagnetsToSideWall.gif
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
assembly-guide/gifs/attachSideConnectorModulesToYBars.gif
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
assembly-guide/gifs/attachXBarWithYBar.gif
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
assembly-guide/gifs/attachXYPlates.gif
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
assembly-guide/gifs/attachXYTrays.gif
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
assembly-guide/gifs/connectXYTrayWithMainRails.gif
Normal file
|
After Width: | Height: | Size: 34 KiB |
BIN
assembly-guide/gifs/insertDowelsIntoSideWall.gif
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
assembly-guide/gifs/insertFeet.gif
Normal file
|
After Width: | Height: | Size: 48 KiB |
BIN
assembly-guide/gifs/propUpBottomXYTraywithSideWalls.gif
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
assembly-guide/gifs/screwFeet.gif
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
assembly-guide/gifs/screwXBarAndYBar.gif
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
assembly-guide/gifs/slideHexNutToFeet.gif
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
assembly-guide/gifs/slideHexNutsIntoYBar.gif
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
assembly-guide/gifs/slideHexNutsIntoYBarXYPlate.gif
Normal file
|
After Width: | Height: | Size: 53 KiB |
@ -22,7 +22,7 @@ _profileConfigs = [
|
||||
["micro", [
|
||||
["maxUnitWidth", 180],
|
||||
["maxUnitDepth", 180],
|
||||
["numRailScrews", 18]
|
||||
["numRailScrews", 12]
|
||||
]],
|
||||
["mini", [
|
||||
["maxUnitWidth", 205],
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
$fn=64;
|
||||
eps=0.001;
|
||||
rh=1; // preview render helper :)
|
||||
inf10 = 10;
|
||||
inf50 = 50;
|
||||
inf1000 = 1000;
|
||||
|
||||
@ -3,14 +3,29 @@
|
||||
|
||||
name="anim"
|
||||
|
||||
# Check if an argument is provided and update the variable if so
|
||||
# TODO provide through script
|
||||
png_dir="./assembly-guide/gifs/tmp"
|
||||
target_dir="./assembly-guide/gifs"
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
name="$1"
|
||||
fi
|
||||
|
||||
if [ -n "$2" ]; then
|
||||
png_dir="$2"
|
||||
fi
|
||||
|
||||
if [ -n "$3" ]; then
|
||||
target_dir="$3"
|
||||
fi
|
||||
|
||||
echo "Current directory: $(pwd)"
|
||||
|
||||
filename_without_extension="${name%.*}"
|
||||
|
||||
# needs tomorrow night openscad theme
|
||||
convert -resize 20% -delay 6 -loop 0 -transparent "#1d1f21" -dispose previous frame000*.png "$filename_without_extension".gif
|
||||
# convert -resize 20% -delay 6 -loop 0 -transparent "#1d1f21" -dispose previous frame000*.png "$filename_without_extension".gif
|
||||
|
||||
gifsicle -O3 --colors=64 --scale 0.5 -i "$filename_without_extension".gif -o "$filename_without_extension".gif
|
||||
convert -resize 20% -delay 6 -loop 0 -dispose previous "$png_dir"/"$filename_without_extension"000*.png "$target_dir"/"$filename_without_extension".gif
|
||||
|
||||
gifsicle -O3 --colors=64 --scale 0.5 -i "$target_dir"/"$filename_without_extension".gif -o "$target_dir"/"$filename_without_extension".gif
|
||||
@ -4,7 +4,7 @@ include <../rack/sharedVariables.scad>
|
||||
use <./plateBase.scad>
|
||||
|
||||
|
||||
patchPanel(slots=2);
|
||||
*patchPanel(slots=2);
|
||||
|
||||
module patchPanel (slots=8) {
|
||||
difference() {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
include <./common.scad>
|
||||
|
||||
|
||||
plateBase(U=2, plateThickness=3, screwType="m4", filletR=2);
|
||||
*plateBase(U=2, plateThickness=3, screwType="m4", filletR=2);
|
||||
|
||||
module plateBase(U, plateThickness, screwType, screwToXEdge=4.5, screwToYEdge=4.5, filletR=2) {
|
||||
|
||||
|
||||
25
rack/assembly/addMagnetsToMagnetModules.scad
Normal file
@ -0,0 +1,25 @@
|
||||
include <./common.scad>
|
||||
|
||||
$vpt = [21,-15,20];
|
||||
$vpr = [65,0,40];
|
||||
$vpd = 50;
|
||||
$vpf = 22.50;
|
||||
|
||||
addMagnetsToMagnetModules(at=$t);
|
||||
|
||||
module addMagnetsToMagnetModules(at=0) {
|
||||
t = lerp(a=8,b=0,t=at);
|
||||
|
||||
if (!plasticMask) {
|
||||
magnetModule();
|
||||
}
|
||||
|
||||
function insertMagnetTrans(t=0) =
|
||||
translate(v=[sideWallConnW-(magnetFaceToSideWallConnOuterYEdge+magnetHSlacked) + t,
|
||||
magnetModuleMagnetMountDy,
|
||||
magnetModuleMagnetMountDz]) *
|
||||
rotate(a=[0,90,0]);
|
||||
|
||||
multmatrix(insertMagnetTrans(t=t))
|
||||
magnet();
|
||||
}
|
||||
26
rack/assembly/addMagnetsToSideWall.scad
Normal file
@ -0,0 +1,26 @@
|
||||
include <./common.scad>
|
||||
|
||||
$vpt = [40,44,70];
|
||||
$vpr = [77,0,40];
|
||||
$vpd = 370;
|
||||
$vpf = 22.50;
|
||||
|
||||
addMagnetsToSideWall(at=$t);
|
||||
|
||||
module addMagnetsToSideWall(at=0) {
|
||||
t = lerp(a=8,b=0,t=at);
|
||||
|
||||
if (!plasticMask) {
|
||||
sideWallLeft();
|
||||
}
|
||||
|
||||
function insertMagnetTrans(t=0) =
|
||||
translate(v=[sideWallThickness+t, magnetMountToYBarFront, magnetMountToYBarTop-sideWallZHingeTotalClearance]) *
|
||||
rotate(a=[0,90,0]);
|
||||
|
||||
multmatrix(insertMagnetTrans(t=t))
|
||||
magnet();
|
||||
|
||||
multmatrix(translate(v=[0,0,sideWallZ - 2*(magnetMountToYBarTop- sideWallZHingeTotalClearance)]) * insertMagnetTrans(t=t))
|
||||
magnet();
|
||||
}
|
||||
59
rack/assembly/attachSideConnectorModulesToYBars.scad
Normal file
@ -0,0 +1,59 @@
|
||||
include <./common.scad>
|
||||
use <./screwXBarAndYBar.scad>
|
||||
use <./addMagnetsToMagnetModules.scad>
|
||||
|
||||
$vpt = [116,90,18];
|
||||
$vpr = [56,0,42];
|
||||
$vpd = 550;
|
||||
$vpf = 22.50;
|
||||
|
||||
attachSideConnectorModulesToYBars(at=$t);
|
||||
|
||||
module attachSideConnectorModulesToYBars(at=0) {
|
||||
elevation = lerp(a=8, b=0, t=at);
|
||||
|
||||
// side module to front corner ybar
|
||||
function sideModuleTrans(t=0) =
|
||||
translate(v=[sideWallConnW,0,t-sideWallConnLugDepression])
|
||||
* yBarSideModuleConnectorTrans
|
||||
* mirror(v=[1,0,0]); // mirror for magnetModule
|
||||
|
||||
screwXBarAndYBar(at=1);
|
||||
|
||||
multmatrix(sideModuleTrans(elevation))
|
||||
union() {
|
||||
addMagnetsToMagnetModules(at=1);
|
||||
|
||||
translate(v=[yBarScrewHoleToOuterYEdge,yBarScrewHoleToFrontXEdge,sideWallConnLugDepression + 2*elevation])
|
||||
caseScrewA();
|
||||
}
|
||||
|
||||
multmatrix(xBarSpaceToYBarSpace * xBarMirrorOtherCornerTrans * yBarSpaceToXBarSpace * sideModuleTrans(elevation))
|
||||
union() {
|
||||
addMagnetsToMagnetModules(at=1);
|
||||
|
||||
translate(v=[yBarScrewHoleToOuterYEdge,yBarScrewHoleToFrontXEdge,sideWallConnLugDepression + 2*elevation])
|
||||
caseScrewA();
|
||||
}
|
||||
|
||||
multmatrix(yBarMirrorOtherCornerTrans * sideModuleTrans(elevation))
|
||||
union() {
|
||||
|
||||
if (!plasticMask) {
|
||||
hingeModule();
|
||||
}
|
||||
|
||||
translate(v=[yBarScrewHoleToOuterYEdge,yBarScrewHoleToFrontXEdge,sideWallConnLugDepression + 2*elevation])
|
||||
caseScrewA();
|
||||
}
|
||||
|
||||
multmatrix(xBarSpaceToYBarSpace * xBarMirrorOtherCornerTrans * yBarSpaceToXBarSpace * yBarMirrorOtherCornerTrans * sideModuleTrans(elevation))
|
||||
union() {
|
||||
if (!plasticMask) {
|
||||
hingeModule();
|
||||
}
|
||||
|
||||
translate(v=[yBarScrewHoleToOuterYEdge,yBarScrewHoleToFrontXEdge,sideWallConnLugDepression + 2*elevation])
|
||||
caseScrewA();
|
||||
}
|
||||
}
|
||||
29
rack/assembly/attachXBarWithYBar.scad
Normal file
@ -0,0 +1,29 @@
|
||||
include <./common.scad>
|
||||
use <./slideHexNutsIntoYBar.scad>
|
||||
|
||||
$vpt = [116,90,18];
|
||||
$vpr = [56,0,42];
|
||||
$vpd = 550;
|
||||
$vpf = 22.50;
|
||||
|
||||
attachXBarWithYBar(at=$t);
|
||||
|
||||
module attachXBarWithYBar(at=0) {
|
||||
|
||||
t = lerp(a=20, b=0, t=at);
|
||||
|
||||
// assemble x-y bar trays
|
||||
multmatrix(translate(v = [0, 0, t]))
|
||||
slideHexNutsIntoYBar(at=1);
|
||||
|
||||
multmatrix(translate(v = [0, 0, t])*xBarSpaceToYBarSpace*xBarMirrorOtherCornerTrans*yBarSpaceToXBarSpace)
|
||||
slideHexNutsIntoYBar(at=1);
|
||||
|
||||
if (!plasticMask) {
|
||||
multmatrix(xBarSpaceToYBarSpace)
|
||||
xBar();
|
||||
|
||||
multmatrix(yBarMirrorOtherCornerTrans*xBarSpaceToYBarSpace)
|
||||
xBar();
|
||||
}
|
||||
}
|
||||
50
rack/assembly/attachXYPlates.scad
Normal file
@ -0,0 +1,50 @@
|
||||
include <./common.scad>
|
||||
use <./slideHexNutsIntoYBarXYPlate.scad>
|
||||
|
||||
$vpt = [96,110,70];
|
||||
$vpr = [68,0,36];
|
||||
$vpd = 700;
|
||||
$vpf = 22.50;
|
||||
|
||||
attachXYPlates(at=$t);
|
||||
|
||||
module attachXYPlates(at=0,r=0) {
|
||||
|
||||
t = lerp(a=10,b=0,t=at);
|
||||
|
||||
// TODO fix xyPlate transformations
|
||||
function xyPlateToYBarTrans() = translate(v=[6,6,0]) * yBarBasePlateConnectorTrans;
|
||||
|
||||
slideHexNutsIntoYBarXYPlate(at=1);
|
||||
|
||||
multmatrix(xyPlateToYBarTrans())
|
||||
xyPlateWithScrews(t=t);
|
||||
|
||||
multmatrix(upperXYTrayTrans * xyPlateToYBarTrans())
|
||||
xyPlateWithScrews(t=t);
|
||||
|
||||
module xyPlateWithScrews(t=0) {
|
||||
|
||||
module screw(t=0) {
|
||||
translate(v=[0,0,-t])
|
||||
mirror(v=[0,0,1])
|
||||
caseScrewA();
|
||||
}
|
||||
|
||||
if (!plasticMask) {
|
||||
translate(v = [0, 0, -t])
|
||||
xyPlate();
|
||||
}
|
||||
|
||||
screw(t=2*t);
|
||||
|
||||
translate(v=[xyPlateConnDx, 0,0])
|
||||
screw(t=2*t);
|
||||
|
||||
translate(v=[0, xyPlateConnDy,0])
|
||||
screw(t=2*t);
|
||||
|
||||
translate(v=[xyPlateConnDx, xyPlateConnDy,0])
|
||||
screw(t=2*t);
|
||||
}
|
||||
}
|
||||
36
rack/assembly/attachXYTrays.scad
Normal file
@ -0,0 +1,36 @@
|
||||
include <./common.scad>
|
||||
use <./attachSideConnectorModulesToYBars.scad>
|
||||
use <./propUpBottomXYTraywithSideWalls.scad>
|
||||
|
||||
$vpt = [71,123,88];
|
||||
$vpr = [44,0,47];
|
||||
$vpd = 450;
|
||||
$vpf = 22.50;
|
||||
|
||||
attachXYTrays(at=$t);
|
||||
|
||||
module attachXYTrays(at=0,r=0) {
|
||||
|
||||
t1 = lerp(a=12, b=0, t=min(1, 2*at));
|
||||
t2 = lerp(a=16, b=0, t=max(0, 2*at - 1));
|
||||
|
||||
module singleScrew() {
|
||||
translate(v = [mainRailSlideHexOnYBarDx, mainRailSlideHexOnYBarDy, -5])
|
||||
rotate(a=[-45,0,0])
|
||||
translate(v=[0,0,14 + t2]) // length of caseScrewB
|
||||
caseScrewA();
|
||||
}
|
||||
|
||||
translate(v=[0,0,t1])
|
||||
multmatrix(upperXYTrayTrans) {
|
||||
attachSideConnectorModulesToYBars(at=1);
|
||||
|
||||
if (at >= 1/2) {
|
||||
mirrorAllTrayCornersFromYBarSpace()
|
||||
multmatrix(yBarMainRailConnectorTrans)
|
||||
singleScrew();
|
||||
}
|
||||
}
|
||||
|
||||
propUpBottomXYTraywithSideWalls(at=1,r=r);
|
||||
}
|
||||
106
rack/assembly/common.scad
Normal file
@ -0,0 +1,106 @@
|
||||
include <../../helper/common.scad>
|
||||
include <../../config/common.scad>
|
||||
include <../mainRail.scad>
|
||||
include <../yBar.scad>
|
||||
include <../xBar.scad>
|
||||
include <../side/magnetModule.scad>
|
||||
include <../side/hingeModule.scad>
|
||||
include <../side/sideWallRight.scad>
|
||||
include <../side/sideWallLeft.scad>
|
||||
include <../stackEnds.scad>
|
||||
include <../xyPlate.scad>
|
||||
|
||||
screwMask = false;
|
||||
plasticMask = false;
|
||||
sideSupportRailMask = true;
|
||||
|
||||
|
||||
xBarSpaceToYBarSpace =
|
||||
yBarXBarConnectorTrans *
|
||||
xBarConnectorToYBarConnectorTrans *
|
||||
inv4x4(xBarYBarConnectorTrans);
|
||||
|
||||
yBarSpaceToXBarSpace =
|
||||
xBarYBarConnectorTrans *
|
||||
yBarConnectorToXBarConnectorTrans *
|
||||
inv4x4(yBarXBarConnectorTrans);
|
||||
|
||||
upperXYTrayTrans =
|
||||
yBarMainRailConnectorTrans *
|
||||
mirrorMainRailOtherSideTrans *
|
||||
inv4x4(yBarMainRailConnectorTrans);
|
||||
|
||||
function feetToYBarTrans(t=0) =
|
||||
translate(v=[connectorRectWidth/2,connectorRectDepth/2,-t]) *
|
||||
yBarStackConnectorTrans *
|
||||
mirror(v=[0,1,0]);
|
||||
|
||||
function stackConnectorTrans(t=0) =
|
||||
upperXYTrayTrans *
|
||||
yBarStackConnectorTrans;
|
||||
|
||||
module mirrorAllTrayCornersFromYBarSpace() {
|
||||
children(0);
|
||||
|
||||
multmatrix(yBarMirrorOtherCornerTrans)
|
||||
children(0);
|
||||
|
||||
multmatrix(xBarSpaceToYBarSpace * xBarMirrorOtherCornerTrans * yBarSpaceToXBarSpace * yBarMirrorOtherCornerTrans)
|
||||
children(0);
|
||||
|
||||
multmatrix(xBarSpaceToYBarSpace * xBarMirrorOtherCornerTrans * yBarSpaceToXBarSpace * yBarMirrorOtherCornerTrans * yBarMirrorOtherCornerTrans)
|
||||
children(0);
|
||||
}
|
||||
|
||||
secondStackTrans = upperXYTrayTrans * mirror(v=[0,0,1]);
|
||||
|
||||
|
||||
module caseScrewA() {
|
||||
if (!screwMask) {
|
||||
color([1, 1, 1]) {
|
||||
difference() {
|
||||
scale(v = [0.9, 0.9, 0.9])
|
||||
counterSunkHead_N(rackFrameScrewType, screwExtension = 10, headExtension = 0.5);
|
||||
|
||||
cylinder($fn = 6, r = 1.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module caseScrewB() {
|
||||
if (!screwMask) {
|
||||
color([1, 1, 1]) {
|
||||
difference() {
|
||||
scale(v = [0.9, 0.9, 0.9])
|
||||
counterSunkHead_N(rackFrameScrewType, screwExtension = 14, headExtension = 0.5);
|
||||
|
||||
cylinder($fn = 6, r = 1.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module hingeDowel() {
|
||||
if (!screwMask) {
|
||||
color([0, 1, 1])
|
||||
cylinder(h = dowelPinH, r = dowelPinR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module magnet() {
|
||||
if (!screwMask) {
|
||||
color([1, 1, 1])
|
||||
cylinder(r = magnetR, h = magnetH);
|
||||
}
|
||||
}
|
||||
|
||||
module arrow(length) {
|
||||
color([1,0,1]) {
|
||||
translate(v = [0, 0, length-2])
|
||||
cylinder(r1 = 2, r2 = 0.2, h = 2);
|
||||
|
||||
cylinder(r = 1, h = length-2);
|
||||
}
|
||||
}
|
||||
47
rack/assembly/connectXYTrayWithMainRails.scad
Normal file
@ -0,0 +1,47 @@
|
||||
include <./common.scad>
|
||||
use <./attachSideConnectorModulesToYBars.scad>
|
||||
|
||||
$vpt = [96,110,70];
|
||||
$vpr = [68,0,36];
|
||||
$vpd = 700;
|
||||
$vpf = 22.50;
|
||||
|
||||
connectXYTrayWithMainRails(at=$t);
|
||||
|
||||
module connectXYTrayWithMainRails(at=0) {
|
||||
|
||||
attachSideConnectorModulesToYBars(at=1);
|
||||
|
||||
function mainRailTrans() =
|
||||
yBarMainRailConnectorTrans;
|
||||
|
||||
module railAndScrew(at) {
|
||||
t1 = lerp(a=12, b=0, t=min(1, 2*at));
|
||||
t2 = lerp(a=16, b=0, t=max(0, 2*at - 1));
|
||||
|
||||
if (!plasticMask) {
|
||||
translate(v=[0,0,t1])
|
||||
mainRail();
|
||||
}
|
||||
|
||||
if (at >= 1/2) {
|
||||
multmatrix(
|
||||
translate(v = [mainRailSlideHexOnYBarDx, mainRailSlideHexOnYBarDy, -5])*
|
||||
rotate(a = [-45, 0, 0]))
|
||||
translate(v = [0, 0, 14 + t2]) // length of caseScrewB
|
||||
caseScrewB();
|
||||
}
|
||||
}
|
||||
|
||||
multmatrix(mainRailTrans())
|
||||
railAndScrew(at=at);
|
||||
|
||||
multmatrix(yBarMirrorOtherCornerTrans * mainRailTrans())
|
||||
railAndScrew(at=at);
|
||||
|
||||
multmatrix(xBarSpaceToYBarSpace * xBarMirrorOtherCornerTrans * yBarSpaceToXBarSpace * mainRailTrans())
|
||||
railAndScrew(at=at);
|
||||
|
||||
multmatrix(xBarSpaceToYBarSpace * xBarMirrorOtherCornerTrans * yBarSpaceToXBarSpace * yBarMirrorOtherCornerTrans * mainRailTrans())
|
||||
railAndScrew(at=at);
|
||||
}
|
||||
@ -1,47 +1,43 @@
|
||||
include <../helper/common.scad>
|
||||
include <../config/common.scad>
|
||||
include <./mainRail.scad>
|
||||
include <./yBar.scad>
|
||||
include <./xBar.scad>
|
||||
include <./side/magnetModule.scad>
|
||||
include <./side/hingeModule.scad>
|
||||
include <./side/sideWallRight.scad>
|
||||
include <./side/sideWallLeft.scad>
|
||||
include <./stackEnds.scad>
|
||||
include <./xyPlate.scad>
|
||||
include <./common.scad>
|
||||
|
||||
include <../rack-mount/side-rail/dualMount.scad>
|
||||
$vpt = [23,22,20];
|
||||
$vpr = [57,0,46];
|
||||
$vpd = 60;
|
||||
|
||||
// TODO: this is completly broken. fix this and figure out a nice way to run this with cli commands
|
||||
assemblyInstructions();
|
||||
assemblyInstructions(stepNum=0);
|
||||
|
||||
module assemblyInstructions () {
|
||||
module assemblyInstructions (stepNum=1) {
|
||||
|
||||
screwMask = false;
|
||||
plasticMask = false;
|
||||
sideSupportRailMask = true;
|
||||
|
||||
// Instruction List (in order)
|
||||
// render()
|
||||
// addHeatSetInsertsYBar(at=$t);
|
||||
// addMagnetsToMagnetModules(at=$t);
|
||||
// addMagnetsToSideWall(at=$t);
|
||||
// attachXBarWithYBar(at=$t);
|
||||
// screwXBarAndYBar(at=$t);
|
||||
// attachSideConnectorModulesToYBars(at=$t);
|
||||
// connectXYTrayWithMainRails(at=1);
|
||||
// insertDowelsIntoSideWall(at=$t);
|
||||
// propUpBottomXYTraywithSideWalls(at=$t);
|
||||
// attachXYTrays(at=$t);
|
||||
// slideHexNutToFeet(at=$t);
|
||||
// insertFeet(at=$t);
|
||||
// screwFeet(at=$t);
|
||||
// attachXYPlates(at=$t);
|
||||
module pickStep(stepNum) {
|
||||
children(stepNum);
|
||||
}
|
||||
|
||||
pickStep(stepNum=stepNum) {
|
||||
slideHexNutsIntoYBar(at = $t); // moved
|
||||
addMagnetsToMagnetModules(at = $t); // moved
|
||||
addMagnetsToSideWall(at = $t); // moved
|
||||
attachXBarWithYBar(at = $t); // moved
|
||||
screwXBarAndYBar(at=$t); // moved
|
||||
attachSideConnectorModulesToYBars(at=$t); // moved
|
||||
connectXYTrayWithMainRails(at=1); // moved
|
||||
insertDowelsIntoSideWall(at=$t); // moved
|
||||
propUpBottomXYTraywithSideWalls(at=$t); // moved
|
||||
attachXYTrays(at=$t); // moved
|
||||
slideHexNutToFeet(at=$t);
|
||||
insertFeet(at=$t); // moved
|
||||
screwFeet(at=$t); // moved
|
||||
attachXYPlates(at=$t); // moved
|
||||
}
|
||||
|
||||
|
||||
// Final builds:
|
||||
// render()
|
||||
finalSingle();
|
||||
// finalSingle();
|
||||
// finalDouble();
|
||||
|
||||
// Features:
|
||||
@ -51,7 +47,9 @@ module assemblyInstructions () {
|
||||
// sideSwivel(at=$t);
|
||||
|
||||
|
||||
module addHeatSetInsertsYBar(at=0) {
|
||||
module slideHexNutsIntoYBar(at=0) {
|
||||
|
||||
|
||||
t = lerp(a=10,b=0.35,t=at); // non zero b for exposing the heatset gears for diagramming
|
||||
|
||||
if (!plasticMask) {
|
||||
@ -65,7 +63,7 @@ module assemblyInstructions () {
|
||||
yBarSideModuleConnectorTrans;
|
||||
|
||||
function mainRailHeatSetTrans(t=0) =
|
||||
translate(v=[mainRailHeatSetOnYBarDx,mainRailHeatSetOnYBarDy,t-heatSetHeight]) *
|
||||
translate(v=[mainRailSlideHexOnYBarDx,mainRailSlideHexOnYBarDy,t-heatSetHeight]) *
|
||||
yBarMainRailConnectorTrans;
|
||||
|
||||
function xBarHeatSetTrans(t=0) =
|
||||
@ -134,10 +132,10 @@ module assemblyInstructions () {
|
||||
|
||||
// assemble x-y bar trays
|
||||
multmatrix(translate(v = [0, 0, t]))
|
||||
addHeatSetInsertsYBar(at=1);
|
||||
slideHexNutsIntoYBar(at=1);
|
||||
|
||||
multmatrix(translate(v = [0, 0, t])*xBarSpaceToYBarSpace*xBarMirrorOtherCornerTrans*yBarSpaceToXBarSpace)
|
||||
addHeatSetInsertsYBar(at=1);
|
||||
slideHexNutsIntoYBar(at=1);
|
||||
|
||||
if (!plasticMask) {
|
||||
multmatrix(xBarSpaceToYBarSpace)
|
||||
@ -156,10 +154,10 @@ module assemblyInstructions () {
|
||||
translate(v=[27,xBarSideThickness + extension,6]) * rotate(a=[270,0,0]);
|
||||
|
||||
// screw to connect x and y bars
|
||||
addHeatSetInsertsYBar(at=1);
|
||||
slideHexNutsIntoYBar(at=1);
|
||||
|
||||
multmatrix(xBarSpaceToYBarSpace*xBarMirrorOtherCornerTrans*yBarSpaceToXBarSpace)
|
||||
addHeatSetInsertsYBar(at=1);
|
||||
slideHexNutsIntoYBar(at=1);
|
||||
|
||||
multmatrix(xBarSpaceToYBarSpace)
|
||||
union() {
|
||||
@ -554,94 +552,5 @@ module assemblyInstructions () {
|
||||
finalSingle(r=r);
|
||||
}
|
||||
|
||||
xBarSpaceToYBarSpace =
|
||||
yBarXBarConnectorTrans *
|
||||
xBarConnectorToYBarConnectorTrans *
|
||||
inv4x4(xBarYBarConnectorTrans);
|
||||
|
||||
yBarSpaceToXBarSpace =
|
||||
xBarYBarConnectorTrans *
|
||||
yBarConnectorToXBarConnectorTrans *
|
||||
inv4x4(yBarXBarConnectorTrans);
|
||||
|
||||
upperXYTrayTrans =
|
||||
yBarMainRailConnectorTrans *
|
||||
mirrorMainRailOtherSideTrans *
|
||||
inv4x4(yBarMainRailConnectorTrans);
|
||||
|
||||
function feetToYBarTrans(t=0) =
|
||||
translate(v=[connectorRectWidth/2,connectorRectDepth/2,-t]) *
|
||||
yBarStackConnectorTrans *
|
||||
mirror(v=[0,1,0]);
|
||||
|
||||
function stackConnectorTrans(t=0) =
|
||||
upperXYTrayTrans *
|
||||
yBarStackConnectorTrans;
|
||||
|
||||
module mirrorAllTrayCornersFromYBarSpace() {
|
||||
children(0);
|
||||
|
||||
multmatrix(yBarMirrorOtherCornerTrans)
|
||||
children(0);
|
||||
|
||||
multmatrix(xBarSpaceToYBarSpace * xBarMirrorOtherCornerTrans * yBarSpaceToXBarSpace * yBarMirrorOtherCornerTrans)
|
||||
children(0);
|
||||
|
||||
multmatrix(xBarSpaceToYBarSpace * xBarMirrorOtherCornerTrans * yBarSpaceToXBarSpace * yBarMirrorOtherCornerTrans * yBarMirrorOtherCornerTrans)
|
||||
children(0);
|
||||
}
|
||||
|
||||
secondStackTrans = upperXYTrayTrans * mirror(v=[0,0,1]);
|
||||
|
||||
|
||||
module caseScrewA() {
|
||||
if (!screwMask) {
|
||||
color([1, 1, 1]) {
|
||||
difference() {
|
||||
scale(v = [0.9, 0.9, 0.9])
|
||||
counterSunkHead_N(rackFrameScrewType, screwExtension = 6, headExtension = 0.5);
|
||||
|
||||
cylinder($fn = 6, r = 1.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module caseScrewB() {
|
||||
if (!screwMask) {
|
||||
color([1, 1, 1]) {
|
||||
difference() {
|
||||
scale(v = [0.9, 0.9, 0.9])
|
||||
counterSunkHead_N(rackFrameScrewType, screwExtension = 10, headExtension = 0.5);
|
||||
|
||||
cylinder($fn = 6, r = 1.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module hingeDowel() {
|
||||
if (!screwMask) {
|
||||
color([0, 1, 1])
|
||||
cylinder(h = dowelPinH, r = dowelPinR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module magnet() {
|
||||
if (!screwMask) {
|
||||
color([1, 1, 1])
|
||||
cylinder(r = magnetR, h = magnetH);
|
||||
}
|
||||
}
|
||||
|
||||
module arrow(length) {
|
||||
color([1,0,1]) {
|
||||
translate(v = [0, 0, length-2])
|
||||
cylinder(r1 = 2, r2 = 0.2, h = 2);
|
||||
|
||||
cylinder(r = 1, h = length-2);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
25
rack/assembly/insertDowelsIntoSideWall.scad
Normal file
@ -0,0 +1,25 @@
|
||||
include <./common.scad>
|
||||
use <./addMagnetsToSideWall.scad>
|
||||
|
||||
$vpt = [65,120,96];
|
||||
$vpr = [66,0,112];
|
||||
$vpd = 500;
|
||||
$vpf = 22.50;
|
||||
|
||||
insertDowelsIntoSideWall(at=$t);
|
||||
|
||||
module insertDowelsIntoSideWall(at=0) {
|
||||
|
||||
t = lerp(a=10, b=0, t=at);
|
||||
|
||||
hingeHoleH = hingePoleH-sideWallConnLugDepression;
|
||||
|
||||
addMagnetsToSideWall(at=1);
|
||||
|
||||
translate(v=[hingePoleDx,hingePoleDy, (sideWallZ-hingeHoleH) + t])
|
||||
hingeDowel();
|
||||
|
||||
translate(v=[hingePoleDx,hingePoleDy, (hingeHoleH-hingePoleH)-t])
|
||||
hingeDowel();
|
||||
|
||||
}
|
||||
47
rack/assembly/insertFeet.scad
Normal file
@ -0,0 +1,47 @@
|
||||
include <./common.scad>
|
||||
use <./slideHexNutToFeet.scad>
|
||||
use <./attachXYPlates.scad>
|
||||
|
||||
$vpt = [95,90,10];
|
||||
$vpr = [105,0,38];
|
||||
$vpd = 650;
|
||||
$vpf = 22.50;
|
||||
|
||||
insertFeet(at=$t);
|
||||
|
||||
module insertFeet(at=0,r=0) {
|
||||
|
||||
t = lerp(a=10,b=0,t=at);
|
||||
|
||||
attachXYPlates(at=1,r=r);
|
||||
|
||||
multmatrix(feetToYBarTrans(t=t))
|
||||
slideHexNutToFeet(at=1);
|
||||
|
||||
multmatrix(yBarMirrorOtherCornerTrans * feetToYBarTrans(t=t))
|
||||
slideHexNutToFeet(at=1);
|
||||
}
|
||||
|
||||
module screwFeet(at=0,r=0) {
|
||||
|
||||
t = lerp(a=20, b=0, t=at);
|
||||
|
||||
function screwTrans(t=0) = translate(v=[-t - 9,0,connectorBottomToScrew]) * rotate(a=[0,-90,0]);
|
||||
mirrorOtherFeetStackConnectorTrans = translate(v=[stackConnectorDx,0,0]) * mirror(v=[1,0,0]);
|
||||
|
||||
|
||||
module screwToFeetModule() {
|
||||
multmatrix(feetToYBarTrans(t = 0)*screwTrans(t = t))
|
||||
caseScrewB(); // we might want a longer screw?
|
||||
|
||||
multmatrix(feetToYBarTrans(t = 0)*mirrorOtherFeetStackConnectorTrans*screwTrans(t = t))
|
||||
caseScrewB();
|
||||
}
|
||||
|
||||
screwToFeetModule();
|
||||
|
||||
multmatrix(yBarMirrorOtherCornerTrans)
|
||||
screwToFeetModule();
|
||||
|
||||
insertFeet(at=1,r=r);
|
||||
}
|
||||
32
rack/assembly/propUpBottomXYTraywithSideWalls.scad
Normal file
@ -0,0 +1,32 @@
|
||||
include <./common.scad>
|
||||
use <./insertDowelsIntoSideWall.scad>
|
||||
use <./connectXYTrayWithMainRails.scad>
|
||||
|
||||
$vpt = [96,110,70];
|
||||
$vpr = [68,0,36];
|
||||
$vpd = 700;
|
||||
$vpf = 22.50;
|
||||
|
||||
propUpBottomXYTraywithSideWalls(at=$t, r=0);
|
||||
|
||||
module propUpBottomXYTraywithSideWalls(at=0, r=0) {
|
||||
|
||||
t = lerp(a=10,b=0,t=at);
|
||||
|
||||
function sideWallToYBarTrans(t=0,r=0) =
|
||||
yBarMirrorOtherCornerTrans *
|
||||
yBarSideModuleConnectorTrans * // bring to y bar space
|
||||
mirror(v=[0,1,0]) *
|
||||
translate(v=[0,0,t]) *
|
||||
translate(v=[sideWallConnW/2.0, -hingePoleR, sideWallZHingeTotalClearance]) * // bring to side module space
|
||||
rotate(a=[0,0,-r]) *
|
||||
translate(v=[-hingePoleDx, -hingePoleDy, 0]);
|
||||
|
||||
connectXYTrayWithMainRails(at=1);
|
||||
|
||||
multmatrix(sideWallToYBarTrans(t=t, r=r))
|
||||
insertDowelsIntoSideWall(at=1);
|
||||
|
||||
multmatrix(xBarSpaceToYBarSpace * xBarMirrorOtherCornerTrans * yBarSpaceToXBarSpace * sideWallToYBarTrans(t=t,r=r))
|
||||
insertDowelsIntoSideWall(at=1);
|
||||
}
|
||||
33
rack/assembly/screwFeet.scad
Normal file
@ -0,0 +1,33 @@
|
||||
include <./common.scad>
|
||||
use <./insertFeet.scad>
|
||||
|
||||
$vpt = [95,90,10];
|
||||
$vpr = [105,0,38];
|
||||
$vpd = 650;
|
||||
$vpf = 22.50;
|
||||
|
||||
screwFeet(at=$t);
|
||||
|
||||
module screwFeet(at=0,r=0) {
|
||||
|
||||
t = lerp(a=20, b=0, t=at);
|
||||
|
||||
function screwTrans(t=0) = translate(v=[-t - 9,0,connectorBottomToScrew]) * rotate(a=[0,-90,0]);
|
||||
mirrorOtherFeetStackConnectorTrans = translate(v=[stackConnectorDx,0,0]) * mirror(v=[1,0,0]);
|
||||
|
||||
|
||||
module screwToFeetModule() {
|
||||
multmatrix(feetToYBarTrans(t = 0)*screwTrans(t = t))
|
||||
caseScrewA();
|
||||
|
||||
multmatrix(feetToYBarTrans(t = 0)*mirrorOtherFeetStackConnectorTrans*screwTrans(t = t))
|
||||
caseScrewA();
|
||||
}
|
||||
|
||||
screwToFeetModule();
|
||||
|
||||
multmatrix(yBarMirrorOtherCornerTrans)
|
||||
screwToFeetModule();
|
||||
|
||||
insertFeet(at=1,r=r);
|
||||
}
|
||||
42
rack/assembly/screwXBarAndYBar.scad
Normal file
@ -0,0 +1,42 @@
|
||||
include <./common.scad>
|
||||
use <./attachXBarWithYBar.scad>
|
||||
|
||||
$vpt = [103,90,20];
|
||||
$vpr = [68,0,36];
|
||||
$vpd = 500;
|
||||
$vpf = 22.50;
|
||||
|
||||
screwXBarAndYBar(at=$t);
|
||||
|
||||
module screwXBarAndYBar(at=0) {
|
||||
screwExtension = lerp(a=16, b=0, t=at);
|
||||
|
||||
// in x bar space
|
||||
function xBarYBarScrewTrans(extension) =
|
||||
translate(v=[27,xBarSideThickness + extension,8]) * rotate(a=[270,0,0]);
|
||||
|
||||
attachXBarWithYBar(at=1);
|
||||
|
||||
multmatrix(xBarSpaceToYBarSpace)
|
||||
union() {
|
||||
|
||||
if (!plasticMask) { xBar(); }
|
||||
|
||||
multmatrix(xBarYBarScrewTrans(screwExtension))
|
||||
caseScrewB();
|
||||
|
||||
multmatrix(xBarMirrorOtherCornerTrans * xBarYBarScrewTrans(screwExtension))
|
||||
caseScrewB();
|
||||
}
|
||||
|
||||
multmatrix(yBarMirrorOtherCornerTrans*xBarSpaceToYBarSpace)
|
||||
union() {
|
||||
if (!plasticMask) { xBar(); }
|
||||
|
||||
multmatrix(xBarYBarScrewTrans(screwExtension))
|
||||
caseScrewB();
|
||||
|
||||
multmatrix(xBarMirrorOtherCornerTrans * xBarYBarScrewTrans(screwExtension))
|
||||
caseScrewB();
|
||||
}
|
||||
}
|
||||
31
rack/assembly/slideHexNutToFeet.scad
Normal file
@ -0,0 +1,31 @@
|
||||
include <./common.scad>
|
||||
|
||||
$vpt = [75,-10,-14];
|
||||
$vpr = [74,0,120];
|
||||
$vpd = 300;
|
||||
$vpf = 22.50;
|
||||
|
||||
slideHexNutToFeet(at=$t);
|
||||
|
||||
module slideHexNutToFeet(at=0) {
|
||||
|
||||
t = lerp(a=8, b=0, t=at);
|
||||
|
||||
module slideNut() {
|
||||
if (!screwMask) {
|
||||
rotate(a = [0, 0, 90])
|
||||
rotate(a = [90, 0, 0])
|
||||
hexNut(rackFrameScrewType);
|
||||
}
|
||||
}
|
||||
|
||||
translate(v=[0,t,connectorBottomToScrew + 0.5]) // where does this come from again? slack?
|
||||
slideNut();
|
||||
|
||||
translate(v=[stackConnectorDx,t,connectorBottomToScrew + 0.5]) // where does this come from again? slack?
|
||||
slideNut();
|
||||
|
||||
if (!plasticMask) {
|
||||
stackConnectorFeet();
|
||||
}
|
||||
}
|
||||
52
rack/assembly/slideHexNutsIntoYBar.scad
Normal file
@ -0,0 +1,52 @@
|
||||
include <./common.scad>
|
||||
|
||||
$vpt = [43,66,41];
|
||||
$vpr = [44,0,47];
|
||||
$vpd = 350;
|
||||
$vpf = 22.50;
|
||||
|
||||
slideHexNutsIntoYBar(at=$t);
|
||||
|
||||
module slideHexNutsIntoYBar(at=0)
|
||||
{
|
||||
|
||||
t = lerp(a=20,b=0,t=at);
|
||||
|
||||
if (!plasticMask) {
|
||||
yBar();
|
||||
}
|
||||
|
||||
function sideModuleTrans(t=0) =
|
||||
yBarSideModuleConnectorTrans *
|
||||
translate(v = [yBarScrewHoleToOuterYEdge, yBarScrewHoleToFrontXEdge+t, -(4+sideWallConnLugDepression)]) *
|
||||
rotate(a=[0,0,90]);
|
||||
|
||||
function mainRailTrans(t=0) =
|
||||
yBarMainRailConnectorTrans *
|
||||
translate(v = [mainRailSlideHexOnYBarDx+t, mainRailSlideHexOnYBarDy, -5]) *
|
||||
rotate(a=[-45,0,0]);
|
||||
|
||||
function xBarTrans(t=0) =
|
||||
translate(v = [-5, 27, 8+t]) *
|
||||
yBarXBarConnectorTrans *
|
||||
rotate(a=[0,90,0]);
|
||||
|
||||
module slideHexNutsOneCorner(t=0) {
|
||||
multmatrix(sideModuleTrans(t = t))
|
||||
hexNut(rackFrameScrewType);
|
||||
|
||||
multmatrix(mainRailTrans(t = t))
|
||||
hexNut(rackFrameScrewType);
|
||||
|
||||
multmatrix(xBarTrans(t = t))
|
||||
hexNut(rackFrameScrewType);
|
||||
}
|
||||
|
||||
if (!screwMask) {
|
||||
slideHexNutsOneCorner(t = t);
|
||||
|
||||
multmatrix(yBarMirrorOtherCornerTrans)
|
||||
slideHexNutsOneCorner(t = t);
|
||||
}
|
||||
|
||||
}
|
||||
41
rack/assembly/slideHexNutsIntoYBarXYPlate.scad
Normal file
@ -0,0 +1,41 @@
|
||||
include <./common.scad>
|
||||
use <./attachXYTrays.scad>
|
||||
|
||||
$vpt = [71,123,88];
|
||||
$vpr = [44,0,47];
|
||||
$vpd = 450;
|
||||
$vpf = 22.50;
|
||||
|
||||
slideHexNutsIntoYBarXYPlate(at=$t);
|
||||
|
||||
module slideHexNutsIntoYBarXYPlate(at=0) {
|
||||
|
||||
t = lerp(a=12,b=0,t=at);
|
||||
|
||||
attachXYTrays(at=1,r=0);
|
||||
|
||||
slideHexNuts(t=t);
|
||||
|
||||
multmatrix(upperXYTrayTrans)
|
||||
slideHexNuts(t=t);
|
||||
|
||||
module plateHexNut(t) {
|
||||
multmatrix(yBarBasePlateConnectorTrans)
|
||||
translate(v=[_heatSetX+t, _heatSetY, 4 + _baseConnRecession]) // TODO gotta rename these
|
||||
hexNut(rackFrameScrewType);
|
||||
}
|
||||
|
||||
module slideHexNuts(t=0) {
|
||||
|
||||
plateHexNut(t=t);
|
||||
|
||||
translate(v=[xyPlateConnDx, 0,0])
|
||||
plateHexNut(t=-t);
|
||||
|
||||
translate(v=[0, xyPlateConnDy,0])
|
||||
plateHexNut(t=t);
|
||||
|
||||
translate(v=[xyPlateConnDx, xyPlateConnDy,0])
|
||||
plateHexNut(t=-t);
|
||||
}
|
||||
}
|
||||
@ -2,8 +2,8 @@ include <../../helper/common.scad>
|
||||
include <../../config/common.scad>
|
||||
include <../sharedVariables.scad>
|
||||
|
||||
mainRailHeatSetOnYBarDx = railSideMountThickness + 5;
|
||||
mainRailHeatSetOnYBarDy = railFrontThickness + 2;
|
||||
mainRailSlideHexOnYBarDx = railSideMountThickness + 5;
|
||||
mainRailSlideHexOnYBarDy = railFrontThickness + 2;
|
||||
|
||||
module onYBarToMainRailNegative() {
|
||||
|
||||
@ -14,7 +14,7 @@ module onYBarToMainRailNegative() {
|
||||
translate(v=[-slotZSlack/2, -slotSlack/2,0])
|
||||
cube(size = [railTotalWidth+slotZSlack, railTotalDepth + slotSlack, railFootThickness]);
|
||||
|
||||
translate(v = [mainRailHeatSetOnYBarDx, mainRailHeatSetOnYBarDy, -5])
|
||||
translate(v = [mainRailSlideHexOnYBarDx, mainRailSlideHexOnYBarDy, -5])
|
||||
rotate(a=[-45,0,0])
|
||||
hexNutPocket_N("m3", openSide=false, backSpace=5);
|
||||
}
|
||||
@ -36,7 +36,7 @@ module onMainRailYBarConnectorNegative() {
|
||||
|
||||
screwOffset = 9;
|
||||
|
||||
translate(v = [mainRailHeatSetOnYBarDx, mainRailHeatSetOnYBarDy + screwOffset, -5 + screwOffset])
|
||||
translate(v = [mainRailSlideHexOnYBarDx, mainRailSlideHexOnYBarDy + screwOffset, -5 + screwOffset])
|
||||
rotate(a=[-45,0,0])
|
||||
counterSunkHead_N(rackFrameScrewType, screwExtension=inf50, headExtension=inf50);
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ include <../config/common.scad>
|
||||
include <./sharedVariables.scad>
|
||||
include <./connector/connectors.scad>
|
||||
|
||||
mainRail();
|
||||
*mainRail();
|
||||
|
||||
module mainRail() {
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
include <./sideWallBase.scad>
|
||||
|
||||
sideWallLeft();
|
||||
*sideWallLeft();
|
||||
|
||||
module sideWallLeft() {
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
include <./sideWallBase.scad>
|
||||
|
||||
sideWallRight();
|
||||
*sideWallRight();
|
||||
|
||||
module sideWallRight() {
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@ include <../config/common.scad>
|
||||
include <./sharedVariables.scad>
|
||||
include <./connector/connectors.scad>
|
||||
|
||||
xBar();
|
||||
*xBar();
|
||||
|
||||
module xBar() {
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
include <../helper/common.scad>
|
||||
include <./connector/connectors.scad>
|
||||
|
||||
xyPlate();
|
||||
*xyPlate();
|
||||
|
||||
xyPlateConnDx = xBarX + 2*_heatSetX; // X distance between connectors
|
||||
xyPlateConnDy = yBarDepth - 2*basePlateScrewMountToYBarXZFace; // Y distance between connectors
|
||||
|
||||
@ -3,7 +3,7 @@ include <../config/common.scad>
|
||||
include <./connector/connectors.scad>
|
||||
include <./sharedVariables.scad>
|
||||
|
||||
yBar();
|
||||
*yBar();
|
||||
|
||||
module yBar() {
|
||||
|
||||
|
||||
101
rbuild.py
@ -4,12 +4,8 @@ import argparse
|
||||
import subprocess
|
||||
import os
|
||||
|
||||
<<<<<<< HEAD
|
||||
PATH_TO_OPENSCAD = '/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD'
|
||||
=======
|
||||
PATH_TO_OPENSCAD = 'openscad'
|
||||
PATH_TO_OPENSCAD_NIGHTLY = 'path/to/nightly/build'
|
||||
>>>>>>> 380dcb9 (update)
|
||||
PATH_TO_OPENSCAD = '/usr/bin/openscad'
|
||||
PATH_TO_OPENSCAD_NIGHTLY = '/snap/bin/openscad-nightly'
|
||||
|
||||
# For actual dimensions, please see profiles.scad.
|
||||
class BuildSizeConfig:
|
||||
@ -17,7 +13,6 @@ class BuildSizeConfig:
|
||||
MINI = 'mini'
|
||||
MICRO = 'micro'
|
||||
|
||||
|
||||
RACK_BUILD_DIR = './rack/print'
|
||||
RACK_MOUNT_BUILD_DIR = './rack-mount/print'
|
||||
|
||||
@ -26,6 +21,29 @@ BUILD_PARENT_DIR = './stl'
|
||||
RACK_BUILD_TARGET_SUB_DIR = 'rack'
|
||||
RACK_MOUNT_BUILD_TARGET_SUB_DIR = 'rack-mount'
|
||||
|
||||
ASSEMBLY_GIF_DIR = './rack/assembly'
|
||||
ASSEMBLY_GIF_BUILD_DIR = './assembly-guide/gifs'
|
||||
ASSEMBLY_GIF_TEMP_DIR = ASSEMBLY_GIF_BUILD_DIR + '/tmp'
|
||||
BUILD_GIF_FROM_PNG_SCRIPT = './misc/animate.sh'
|
||||
|
||||
ASSEMBLY_STEPS = [
|
||||
('slideHexNutsIntoYBar.scad', 16),
|
||||
('addMagnetsToMagnetModules.scad', 16),
|
||||
('addMagnetsToSideWall.scad', 16),
|
||||
('attachXBarWithYBar.scad', 16),
|
||||
('screwXBarAndYBar.scad', 16),
|
||||
('attachSideConnectorModulesToYBars.scad', 16),
|
||||
('connectXYTrayWithMainRails.scad', 16),
|
||||
('insertDowelsIntoSideWall.scad', 16),
|
||||
('propUpBottomXYTraywithSideWalls.scad', 16),
|
||||
('slideHexNutsIntoYBarXYPlate.scad', 16),
|
||||
('attachXYTrays.scad', 16),
|
||||
('slideHexNutToFeet.scad', 16),
|
||||
('insertFeet.scad', 16),
|
||||
('screwFeet.scad', 16),
|
||||
('attachXYPlates.scad', 16)
|
||||
]
|
||||
|
||||
def main():
|
||||
|
||||
if not assertOpenscadExists():
|
||||
@ -72,6 +90,12 @@ def main():
|
||||
help='Use openscad-nightly command. Should result in much faster build times.'
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'--build_assembly_gifs',
|
||||
action='store_true',
|
||||
help='Generate the GIFS for the assembly guide.'
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
run_build(args)
|
||||
|
||||
@ -79,14 +103,19 @@ def main():
|
||||
def run_build(args):
|
||||
|
||||
build_var = args.b
|
||||
|
||||
if build_var is None:
|
||||
print("Please provide the build (-b) variable") # TODO redundant
|
||||
|
||||
config_var = args.c
|
||||
target_var = args.t
|
||||
dz = args.dz
|
||||
nightly = args.nightly
|
||||
build_gifs = args.build_assembly_gifs
|
||||
|
||||
if (build_var is not None) == (build_gifs is True):
|
||||
print("Please either provide the build (-b) variable, or the build-gifs option (--build-assembly-gifs)")
|
||||
quit()
|
||||
|
||||
if build_gifs:
|
||||
build_assembly_gifs(config_var, dz, nightly)
|
||||
quit()
|
||||
|
||||
if target_var != "":
|
||||
final_target_directory_name = target_var
|
||||
@ -128,12 +157,34 @@ def build_single(build_dir, target_dir, filename, config, dz, nightly):
|
||||
openscad_args = construct_openscad_args(build_dir, target_dir, filename, config, dz)
|
||||
run_openscad(openscad_args, nightly)
|
||||
|
||||
def build_assembly_gifs(config, dz, nightly):
|
||||
print('Building assembly-gifs. Source Dir:', ASSEMBLY_GIF_DIR, ', Target:', ASSEMBLY_GIF_BUILD_DIR)
|
||||
|
||||
def construct_openscad_args(build_dir, target_dir, filename, config, dz):
|
||||
for (fileName, numSteps) in ASSEMBLY_STEPS:
|
||||
print('Rendering', fileName)
|
||||
openscad_args = construct_openscad_animation_args(
|
||||
ASSEMBLY_GIF_DIR, ASSEMBLY_GIF_TEMP_DIR, fileName, config, dz, numSteps
|
||||
)
|
||||
run_openscad(openscad_args, nightly)
|
||||
|
||||
print("Building GIF for", fileName)
|
||||
build_gif_from_png(fileName)
|
||||
print("Done")
|
||||
|
||||
def build_gif_from_png(fileName):
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
script_path = os.path.join(script_dir, BUILD_GIF_FROM_PNG_SCRIPT)
|
||||
try:
|
||||
subprocess.run(["bash", script_path, fileName], check=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(f"Error calling shell script: {e}")
|
||||
|
||||
def construct_openscad_args(build_dir, target_dir, filename, config, dz, format='.stl'):
|
||||
source = os.path.join(build_dir, filename)
|
||||
target = os.path.join(target_dir, os.path.splitext(filename)[0] + '.stl')
|
||||
target = os.path.join(target_dir, os.path.splitext(filename)[0] + format)
|
||||
|
||||
openscad_args = ['-D', 'profileName=\"' + config + '\"']
|
||||
openscad_args = ['--export-format', 'binstl']
|
||||
openscad_args += ['-D', 'profileName=\"' + config + '\"']
|
||||
|
||||
if dz != 0:
|
||||
openscad_args += ['-D', 'numRailScrews=' + dz]
|
||||
@ -146,6 +197,22 @@ def construct_openscad_args(build_dir, target_dir, filename, config, dz):
|
||||
return openscad_args
|
||||
|
||||
|
||||
def construct_openscad_animation_args(build_dir, target_dir, filename, config, dz, steps):
|
||||
source = os.path.join(build_dir, filename)
|
||||
target = os.path.join(target_dir, os.path.splitext(filename)[0] + '.png')
|
||||
|
||||
openscad_args = []
|
||||
openscad_args += ['--colorscheme', 'BeforeDawn']
|
||||
openscad_args += ['--render']
|
||||
openscad_args += ['--imgsize', '1920,1080']
|
||||
openscad_args += ['--projection', 'o']
|
||||
openscad_args += ['--animate', str(steps)]
|
||||
openscad_args += ['-o', target, source]
|
||||
|
||||
return openscad_args
|
||||
|
||||
|
||||
|
||||
def find_rack(filename):
|
||||
return find_scad_file(RACK_BUILD_DIR, filename)
|
||||
|
||||
@ -178,17 +245,13 @@ def run_openscad(options, nightly):
|
||||
else:
|
||||
command = [PATH_TO_OPENSCAD]
|
||||
|
||||
command += ['--export-format', 'binstl'] + options
|
||||
command += options
|
||||
try:
|
||||
subprocess.check_output(command, universal_newlines=True, stderr=subprocess.DEVNULL)
|
||||
|
||||
except FileNotFoundError:
|
||||
print('OpenSCAD command not found! '
|
||||
<<<<<<< HEAD
|
||||
'Please make sure that you have OpenSCAD installed and can run OpenSCAD CLI commands. '
|
||||
=======
|
||||
'Please make sure that you have the OpenSCAD binary configured in rbuild.py.'
|
||||
>>>>>>> 380dcb9 (update)
|
||||
'(Currently needs Linux/Mac for this)')
|
||||
def assertOpenscadExists():
|
||||
return os.path.exists(PATH_TO_OPENSCAD)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
include <../common.scad>
|
||||
include <../rack/screws.scad>
|
||||
include <../sine.scad>
|
||||
include <../../../config/common.scad>
|
||||
include <../../../helper/common.scad>
|
||||
include <../../../rack-mount/plateBase.scad>
|
||||
|
||||
vU = 2;
|
||||
uHeight = 10;
|
||||
@ -20,7 +20,7 @@ frontPlateH = plateScrewDiffH + 2*plateScrewToVEdge;
|
||||
plateScrewToBoxMin = 6;
|
||||
|
||||
|
||||
length = 170;
|
||||
length = 150;
|
||||
resolution = 250;
|
||||
period = PI/6;
|
||||
shift = 0.0;
|
||||
@ -28,11 +28,6 @@ amplitudeFunction = function(x) 2;
|
||||
|
||||
module _frontPlateBody() {
|
||||
|
||||
difference() {
|
||||
translate(v = [- plateScrewToVEdge, 0, - plateScrewToHEdge])
|
||||
cube(size = [frontPlateH, frontPlateThickness, frontPlateV]);
|
||||
}
|
||||
|
||||
translate(v=[5,-3,-1])
|
||||
rotate(a=[180,0,0])
|
||||
sineWaveHull(length, resolution, amplitudeFunction, period+0.02, 2, 5);
|
||||
@ -69,7 +64,6 @@ module _plateHole() {
|
||||
|
||||
|
||||
module frontPlate() {
|
||||
|
||||
difference() {
|
||||
_frontPlateBody();
|
||||
|
||||
@ -90,11 +84,13 @@ module frontPlate() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
difference() {
|
||||
difference() {
|
||||
|
||||
difference() {
|
||||
union() {
|
||||
plateBase(U=2, plateThickness=2.5, screwType="m4", filletR=2);
|
||||
rotate(a = [- 90, 0, 0])
|
||||
frontPlate();
|
||||
}
|
||||
@ -105,7 +101,7 @@ difference() {
|
||||
translate(v=[0,-50,0])
|
||||
cube(size=[100, 100, 30]);
|
||||
|
||||
translate(v=[180-1,0,0])
|
||||
translate(v=[160-1,0,0])
|
||||
mirror(v=[1,0,0]) {
|
||||
rotate(a = [0, - 15, 0])
|
||||
translate(v = [0, - 50, 0])
|
||||
@ -116,14 +112,14 @@ difference() {
|
||||
}
|
||||
// lug holes
|
||||
union() {
|
||||
translate(v=[160,-3,-frontPlateThickness])
|
||||
translate(v=[150,-3,-frontPlateThickness])
|
||||
cube(size=[5.2, 5.2, 3]);
|
||||
translate(v=[160-91.1,-3,-frontPlateThickness])
|
||||
translate(v=[150-91.1,-3,-frontPlateThickness])
|
||||
cube(size=[5.2, 5.2, 3]);
|
||||
}
|
||||
}
|
||||
for (i=[0:5]) {
|
||||
translate(v=[5,i*4 - 0.75,-10])
|
||||
cube(size=[170, 1.5, 20]);
|
||||
cube(size=[150, 1.5, 20]);
|
||||
}
|
||||
}
|
||||
@ -5,8 +5,8 @@ TODO this case has many many problems as it currently is. The following
|
||||
- no locking lid for case
|
||||
*/
|
||||
|
||||
include <../common.scad>
|
||||
|
||||
include <../../../config/common.scad>
|
||||
include <../../../helper/common.scad>
|
||||
// All coordinates are in [x,y], or [x,y,z] format
|
||||
|
||||
pcbDimensions = [56.0, 85.1]; // [x,y]
|
||||
@ -134,7 +134,7 @@ module cutoutProfile_N() {
|
||||
// front I/O
|
||||
mirror(v=[0,1,0])
|
||||
translate(v=[1, -eps*100, pcbThickness-4])
|
||||
cube(size=[58.0 + 0.1, inf50, 19.0 + 0.1]);
|
||||
cube(size=[58.0 + 0.1, inf50, 21 + 0.1]);
|
||||
|
||||
// side I/O
|
||||
translate(v=[-48-3, (pcbDimensions[1]-54)-10, pcbThickness-4])
|
||||
|
||||