init Box
initializing Box
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
OPENSCAD="openscad"
|
OPENSCAD="openscad"
|
||||||
SCAD_FILE="./CardHolder.scad"
|
SCAD_FILE="./CardHolder.scad"
|
||||||
FOLDER=STL/HeroesKeepOut/
|
FOLDER=STL/HeroesKeepOut
|
||||||
|
|
||||||
mkdir -p STL
|
mkdir -p STL
|
||||||
mkdir -p $FOLDER
|
mkdir -p $FOLDER
|
||||||
@@ -9,7 +9,7 @@ mkdir -p $FOLDER
|
|||||||
while IFS=',' read -r b t h name; do
|
while IFS=',' read -r b t h name; do
|
||||||
# Remove quotes around name, replace spaces with -
|
# Remove quotes around name, replace spaces with -
|
||||||
label=$(printf '%s' "$name" | sed 's/"//g; s/ /-/g')
|
label=$(printf '%s' "$name" | sed 's/"//g; s/ /-/g')
|
||||||
output="$FOLDER$label.stl"
|
output="$FOLDER/Cards-$label.stl"
|
||||||
|
|
||||||
echo "Rendering $output..."
|
echo "Rendering $output..."
|
||||||
"$OPENSCAD" \
|
"$OPENSCAD" \
|
||||||
|
|||||||
85
Box.scad
Normal file
85
Box.scad
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
include <BOSL2/std.scad>
|
||||||
|
|
||||||
|
// Parameter for console overwrite
|
||||||
|
b = 58;
|
||||||
|
t = 3;
|
||||||
|
h = 88;
|
||||||
|
name = "Cards";
|
||||||
|
|
||||||
|
module cardHolder(b, t, h, name) {
|
||||||
|
|
||||||
|
// floor
|
||||||
|
bInner = b - 10;
|
||||||
|
tInner = t - 10;
|
||||||
|
if (bInner >= 6 && tInner >= 6) {
|
||||||
|
difference() {
|
||||||
|
cube([ b, t, 1.5 ], false);
|
||||||
|
bSpace = 5 + (((bInner + 2) % 8) / 2);
|
||||||
|
bAmount = (((bInner + 2) - bSpace + 5) / 8);
|
||||||
|
tSpace = 5 + (((tInner + 2) % 8) / 2);
|
||||||
|
tAmount = (((tInner + 2) - tSpace + 5) / 8);
|
||||||
|
for (i = [0:bAmount - 1], j = [0:tAmount - 1]) {
|
||||||
|
translate([ bSpace + i * 8, tSpace + j * 8, -1 ]) {
|
||||||
|
cube([ 6, 6, 3.5 ], false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
cube([ b, t, 1.5 ], false);
|
||||||
|
}
|
||||||
|
|
||||||
|
// left
|
||||||
|
translate([ 0, 0, 1.5 ]) {
|
||||||
|
cuboid([ 1.5, t, h - 1.5 ], anchor = [ -1, -1, -1 ],
|
||||||
|
rounding = min(10, t - 1.5), edges = FRONT + TOP);
|
||||||
|
}
|
||||||
|
|
||||||
|
// right
|
||||||
|
translate([ b - 1.5, 0, 1.5 ]) {
|
||||||
|
cuboid([ 1.5, t, h - 1.5 ], anchor = [ -1, -1, -1 ],
|
||||||
|
rounding = min(10, t - 1.5), edges = FRONT + TOP);
|
||||||
|
}
|
||||||
|
|
||||||
|
// back
|
||||||
|
translate([ 1.5, t - 1.5, 1.5 ]) {
|
||||||
|
cuboid([ 10, 1.5, h -1.5], anchor = [ -1, -1, -1 ], rounding = 5,
|
||||||
|
edges = RIGHT + TOP);
|
||||||
|
translate([ b - 13, 0, 0 ]) {
|
||||||
|
cuboid([ 10, 1.5, h - 1.5 ], anchor = [ -1, -1, -1 ], rounding = 5,
|
||||||
|
edges = LEFT + TOP);
|
||||||
|
}
|
||||||
|
translate([ 10, 0, 0 ]) {
|
||||||
|
difference() {
|
||||||
|
difference() {
|
||||||
|
cube([ b - 23, 1.5, h - 1 ], false);
|
||||||
|
translate([ 0, -1, 15 ]) {
|
||||||
|
cuboid([ b - 23, 3, h - 12 ], anchor = [ -1, -1, -1 ],
|
||||||
|
rounding = 10, edges = [ LEFT + BOTTOM, RIGHT + BOTTOM ]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
translate([ -1, -1, 35 ]) { cube([ b - 21, 3, h - 20 ], false); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// front
|
||||||
|
translate([ 1, 0, 1 ]) {
|
||||||
|
difference() {
|
||||||
|
cuboid([ 10, 1.5, h - 21 ], anchor = [ -1, -1, -1 ], rounding = 5,
|
||||||
|
edges = RIGHT + TOP);
|
||||||
|
translate([ 7.5, 0.4, 2.5 ]) {
|
||||||
|
rotate([ 0, -90, 90 ]) {
|
||||||
|
linear_extrude(height = 0.6) {
|
||||||
|
text(name, size = 5, font = "Arial:style=Bold");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
translate([ b - 12, 0, 0 ]) {
|
||||||
|
cuboid([ 10, 1.5, h - 21 ], anchor = [ -1, -1, -1 ], rounding = 5,
|
||||||
|
edges = LEFT + TOP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cardHolder(b + 5, t + 3, h + 4, name);
|
||||||
Reference in New Issue
Block a user