2024-03-19 15:13:48 +00:00
|
|
|
#!/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}')
|
2024-03-27 23:11:40 +00:00
|
|
|
make=$(echo "${name}" | awk -F'_' '{print $1}')
|
|
|
|
size=$(echo "${name}" | awk -F'_' '{print $2}')
|
2024-03-19 15:13:48 +00:00
|
|
|
echo "Compiling ${name}..."
|
|
|
|
stl="stl/${name}_front_cap.stl"
|
2024-03-27 23:11:40 +00:00
|
|
|
openscad -o "${stl}" \
|
|
|
|
-D "Diameter=${diameter}" \
|
|
|
|
-D "Thickness=${thickness}" \
|
|
|
|
-D "Height=${height}" \
|
|
|
|
-D "Make=\"${make}\"" \
|
|
|
|
-D "Size=\"${size}\"" \
|
|
|
|
scad/front_cap.scad
|
2024-03-19 15:13:48 +00:00
|
|
|
python scad/common/c14n_stl.py "${stl}"
|
|
|
|
done < ./lenses.csv
|
|
|
|
|
|
|
|
|
|
|
|
README=$(cat ./README.md)
|