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