#!/bin/bash

mkdir -p stl
rm stl/*.stl

echo "=== render flap a"
openscad -o "stl/flap_a.stl" -D PLOT=\"FLAP_A\" -D MODE=\"PLOT\" skirt.scad
echo "=== render flap b"
openscad -o "stl/flap_b.stl" -D PLOT=\"FLAP_B\" -D MODE=\"PLOT\" skirt.scad
echo "=== render flap c"
openscad -o "stl/flap_c.stl" -D PLOT=\"FLAP_C\" -D MODE=\"PLOT\" skirt.scad
for i in $(seq 1 9)
do
    echo "=== render spike ${i}a"
    openscad -o "stl/spike_${i}a.stl" -D PLOT=\"SPIKE_A\" -D MODE=\"PLOT\" skirt.scad
    echo "=== render spike ${i}b"
    openscad -o "stl/spike_${i}b.stl" -D PLOT=\"SPIKE_B\" -D MODE=\"PLOT\" skirt.scad
    echo "=== render spike ${i}c"
    openscad -o "stl/spike_${i}c.stl" -D PLOT=\"SPIKE_C\" -D MODE=\"PLOT\" skirt.scad
    echo "=== render spike ${i}d"
    openscad -o "stl/spike_${i}d.stl" -D PLOT=\"SPIKE_D\" -D MODE=\"PLOT\" skirt.scad
done
