Commit | Line | Data |
---|---|---|
77f399ba VAH |
1 | #!/bin/bash |
2 | #this script generates models for all samples | |
3 | ||
4 | if [ -e configuration.scad.dist ]; then | |
5 | ||
6 | for i in `ls sample_stls` | |
7 | do | |
8 | DIR=sample_stls/$i | |
9 | echo $DIR | |
10 | if [ -e $DIR/configuration.scad ]; then | |
11 | rm configuration.scad | |
12 | cp $DIR/configuration.scad configuration.scad | |
13 | make clean | |
14 | # build standard models | |
15 | make | |
16 | ||
17 | # I do not want all extras in samples, | |
18 | # so lets build only some of them | |
19 | EXTRAS="tube_clamp.stl calibrate.stl" | |
20 | ||
21 | # for box model there is additional part in extras (replaces bushing.stl) | |
22 | # (brackets that hold Y bearings to Y carriage) | |
23 | # and we dont want y-axis-bracket from standard models | |
24 | if grep "i_am_box = 0;" configuration.scad ; then | |
25 | rm output/y-axis-bracket.stl | |
26 | rm output/bushing.stl | |
27 | EXTRAS="$EXTRAS bearing-holder-single-plate-y.stl" | |
28 | fi | |
29 | # build the extras | |
30 | for model in $EXTRAS | |
31 | do | |
32 | make output/extras/$model | |
33 | done | |
34 | ||
35 | cp -f output/*stl $DIR | |
36 | cp -f output/extras/*stl $DIR/extras | |
37 | fi | |
38 | ||
39 | done | |
40 | ||
41 | else | |
42 | echo "configuration.scad.dist not found, aborting" | |
43 | fi |