diff options
Diffstat (limited to 'cubbies.sh')
-rwxr-xr-x | cubbies.sh | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/cubbies.sh b/cubbies.sh new file mode 100755 index 0000000..43a2416 --- /dev/null +++ b/cubbies.sh | |||
@@ -0,0 +1,65 @@ | |||
1 | #!/bin/bash | ||
2 | # this script started off generated using "shopenscad.sh -s cubbies.scad" | ||
3 | |||
4 | usage() { | ||
5 | cat <<EOF | ||
6 | $0: generate sets of cubbies. You will need print the side piece twice for your | ||
7 | first bottom piece, then a single side piece for each additional bottom piece. | ||
8 | |||
9 | Usage: | ||
10 | $0 cubby-depth cubby-height cubby-width1 [cubby-width2 ... cubby-widthN] | ||
11 | |||
12 | Examples: | ||
13 | |||
14 | $0 150 90 20 | ||
15 | |||
16 | Generates two total pieces: a side piece (150mm depth, 90mm height) and a | ||
17 | bottom piece (150mm depth and 20mm width). You will need to print the side | ||
18 | piece twice and bottom piece once. | ||
19 | |||
20 | $0 180 120 20 30 35 | ||
21 | |||
22 | Generates four total pieces, which can be assembled to form a row of | ||
23 | cubbies: one side piece (180mm depth, 120mm height) and three bottom pieces, | ||
24 | with widths of 20mm, 30mm, and 35mm (and each sharing the same depth of | ||
25 | 180mm). The side piece will need to be printed 4 times, and each bottom | ||
26 | piece printed once. | ||
27 | |||
28 | thickness=3 strut_thickness=4 $0 200 140 20 | ||
29 | |||
30 | You can override any of the other variables from your scad file by passing | ||
31 | them into $0 in this manner. | ||
32 | EOF | ||
33 | } | ||
34 | |||
35 | [ "-h" == "$1" ] && usage && exit; | ||
36 | if [ "$#" -lt 3 ]; then | ||
37 | echo "$0: Needs atleast three paramaters. See usage:"; usage; exit 1; | ||
38 | fi; | ||
39 | |||
40 | shopenscad_cmd="./shopenscad.sh cubbies.scad " | ||
41 | |||
42 | export $(echo $($shopenscad_cmd -p)) | ||
43 | # # $ ./shopenscad.sh -p cubbies.scad | ||
44 | # part='"both"' | ||
45 | # cubby_width=40 | ||
46 | # cubby_depth=120 | ||
47 | # cubby_height=90 | ||
48 | # thickness=5 | ||
49 | # strut_thickness=5 | ||
50 | # max_bridge=0 | ||
51 | # tab_width=10 | ||
52 | # tab_padding=5 | ||
53 | # tab_tolerance=0.5 | ||
54 | # screw_tabs=true | ||
55 | |||
56 | cubby_depth=$1; shift | ||
57 | cubby_height=$1; shift | ||
58 | |||
59 | # generate the single side piece | ||
60 | part='"side"' ${shopenscad_cmd} | ||
61 | |||
62 | # generate each bottom piece | ||
63 | for i in "$@"; do | ||
64 | part='"bottom"' cubby_width="$i" ${shopenscad_cmd} | ||
65 | done; | ||