32 lines
813 B
Bash
32 lines
813 B
Bash
#!/bin/bash
|
|
|
|
############################
|
|
#
|
|
# Compile all STL files
|
|
#
|
|
############################
|
|
|
|
while read line; do
|
|
name=$(echo "${line}" | awk -F',' '{print $1}')
|
|
if [[ "${name}" == "lens" ]]; then
|
|
continue;
|
|
fi
|
|
diameter=$(echo "${line}" | awk -F',' '{print $2}')
|
|
height=$(echo "${line}" | awk -F',' '{print $3}')
|
|
thickness=$(echo "${line}" | awk -F',' '{print $4}')
|
|
make=$(echo "${name}" | awk -F'_' '{print $1}')
|
|
size=$(echo "${name}" | awk -F'_' '{print $2}')
|
|
echo "Compiling ${name}..."
|
|
stl="stl/${name}_front_cap.stl"
|
|
openscad -o "${stl}" \
|
|
-D "Diameter=${diameter}" \
|
|
-D "Thickness=${thickness}" \
|
|
-D "Height=${height}" \
|
|
-D "Make=\"${make}\"" \
|
|
-D "Size=\"${size}\"" \
|
|
scad/front_cap.scad
|
|
python scad/common/c14n_stl.py "${stl}"
|
|
done < ./lenses.csv
|
|
|
|
|
|
README=$(cat ./README.md) |