summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteven <steven.vasilogianis@gmail.com>2021-06-25 13:45:25 -0400
committerSteven <steven.vasilogianis@gmail.com>2021-06-25 13:46:41 -0400
commit2ee495c75e7b543ce12512923b5ea006465d1b5a (patch)
treeca5a2337c8b7e6709d29a245c3be80badd81be7c
parent857fdd05da3e9b8790a6c7c970526e409397d5bd (diff)
add documentatoin
-rwxr-xr-xshopenscad.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/shopenscad.sh b/shopenscad.sh
index 7515afe..4e3de98 100755
--- a/shopenscad.sh
+++ b/shopenscad.sh
@@ -1,6 +1,31 @@
1#!/bin/bash 1#!/bin/bash
2# parse a .scad file and generate an openscad command with all its var=value's 2# parse a .scad file and generate an openscad command with all its var=value's
3# parameterized into -D options, which can be overriden with shell variables. 3# parameterized into -D options, which can be overriden with shell variables.
4#
5# Usage examples:
6#
7# $ ./shopenscad.sh cubbies.scad
8# openscad 'cubbies.scad' -D 'part="divider"' -D 'cubby_width=50' -D 'cubby_depth=180' -D 'cubby_divider_height=90' -D 'thickness=5' -D 'strut_thickness=5' -D 'tab_width=10' -D 'tab_padding=5' -D 'tab_tolerance=0.5' -o 'divider=50=180=90=5=5=10=5=0.5.stl'
9# [openscad output omitted]
10#
11# (the openscad command is printed and then evaluated, outputing to the file
12# indicated after the -o flag)
13#
14# You can also overwrite the variables parsed from your scad file by passing a
15# shell variable with the same name:
16#
17# $ cubby_width=200 part=\"bottom\" ./shopenscad.sh cubbies.scad
18# openscad 'cubbies.scad' -D 'part="bottom"' -D 'cubby_width=200' -D 'cubby_depth=180' -D 'cubby_divider_height=90' -D 'thickness=5' -D 'strut_thickness=5' -D 'tab_width=10' -D 'tab_padding=5' -D 'tab_tolerance=0.5' -o 'bottom=200=180=90=5=5=10=5=0.5.stl'
19# [openscad output omitted]
20#
21# Now we can easily generate multiple models:
22#
23# $ for w in 250 300 350 400; do
24# > for p in '"divider"' '"bottom"'; do
25# > cubby_width="$w" part="$p" ./shopenscad.sh cubbies.scad
26# > done
27# > done
28# [openscad output omitted]
4 29
5openscad=${OPENSCAD:-"openscad"} 30openscad=${OPENSCAD:-"openscad"}
6 31