summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven <steven.vasilogianis@gmail.com>2021-11-14 17:41:37 -0500
committerSteven <steven.vasilogianis@gmail.com>2021-11-14 17:41:37 -0500
commit519b1bc4d34499d99e789a73a2767b6f72eb2a61 (patch)
tree9a154e7387de959c38d3ee8938b688b60d757cb9
parentcb5ae1714293d8810fcbe223f20914abb18a1e20 (diff)
documentation and usage
-rwxr-xr-xcubbies.sh37
1 files changed, 29 insertions, 8 deletions
diff --git a/cubbies.sh b/cubbies.sh
index 10c92f6..925b822 100755
--- a/cubbies.sh
+++ b/cubbies.sh
@@ -1,14 +1,35 @@
1#!/bin/bash 1#!/bin/bash
2# this script started off generated using shopenscad.sh -s cubbies.scad
2 3
3usage() { 4usage() {
4 cat <<EOF 5 cat <<EOF
5 $0 cubby-depth cubby-height cubby-width0 cubby-width1 cubby-widthN 6$0 cubby-depth cubby-height cubby-width1 [cubby-width2 ... cubby-widthN]
6 e.g.: 7
7 $0 150 90 20 30 35 8Examples:
9
10 $0 150 90 20
11
12 Generates two total pieces: a side piece (150mm depth, 90mm height) and a
13 bottom piece (150mm depth and 20mm width).
14
15 You will need to print the side piece twice and bottom piece once.
16
17 $0 180 120 20 30 35
18
19 Generates four total pieces, which can be assembled to form a row of
20 cubbies: one side piece (180mm depth, 120mm height) and three bottom pieces,
21 with widths of 20mm, 30mm, and 35mm (and each sharing the same depth of
22 180mm).
23
24 You will need to side piece twice for the first bottom piece, then
25 a single side piece for each additional bottom piece.
8EOF 26EOF
9} 27}
10 28
11[ "-h" == "$1" ] && usage && exit; 29[ "-h" == "$1" ] && usage && exit;
30if [ "$#" -lt 3 ]; then
31 echo "$0: Needs atleast three paramaters. See usage:"; usage; exit 1;
32fi;
12 33
13shopenscad_cmd="./shopenscad.sh cubbies.scad " 34shopenscad_cmd="./shopenscad.sh cubbies.scad "
14 35
@@ -17,11 +38,11 @@ export $(echo $($shopenscad_cmd -p))
17# tab_padding=5 38# tab_padding=5
18# tab_width=10 39# tab_width=10
19# max_bridge=0 40# max_bridge=0
20# # cubby_width=150 41# cubby_width=150
21# # cubby_depth=120 42# cubby_depth=120
22# strut_thickness=5 43# strut_thickness=5
23# screw_tabs=true 44# screw_tabs=true
24# # cubby_height=90 45# cubby_height=90
25# #part="both" 46# #part="both"
26# thickness=3 47# thickness=3
27# tab_tolerance=0.5 48# tab_tolerance=0.5
@@ -29,10 +50,10 @@ export $(echo $($shopenscad_cmd -p))
29cubby_depth=$1; shift 50cubby_depth=$1; shift
30cubby_height=$1; shift 51cubby_height=$1; shift
31 52
32# echo depth: $cubby_depth 53# generate the single side piece
33# echo height: $cubby_height
34part='"side"' ${shopenscad_cmd} 54part='"side"' ${shopenscad_cmd}
35 55
56# generate each bottom piece
36for i in "$@"; do 57for i in "$@"; do
37 part='"bottom"' cubby_width="$i" ${shopenscad_cmd} 58 part='"bottom"' cubby_width="$i" ${shopenscad_cmd}
38done; 59done;