mcopy/scripts/common.sh

17 lines
428 B
Bash
Raw Normal View History

#!/bin/bash
listParts () {
cat "${1}" | grep 'PART ==' | grep -v 'debug' | awk -F'"' '{print $2}'
}
allParts () {
PARTS=($(listParts "scad/${1}.scad"))
for part in "${PARTS[@]}"; do
bash ./scripts/openscadPart.sh "${1}.scad" "${part}" "${1}_${part}.stl"
done
}
parallelParts () {
PARTS=($(listParts "scad/${1}.scad"))
parallel --jobs 8 bash ./scripts/openscadPart.sh "${1}.scad" "{}" "${1}_{}.stl" ::: "${PARTS[@]}"
}