File indexing completed on 2026-11-09 10:47:17
0001
0002
0003
0004 IFS=$'\n'
0005
0006
0007 cd $1
0008
0009
0010 for f in $(find . -type f -name "*.stl" ! -name "*_ASCII.stl"); do
0011
0012 unset IFS
0013
0014 if grep -q 'solid' "$f"; then
0015 echo "$f is already an ASCII STL and should be with name ending _ASCII.stl ."
0016
0017 else
0018 echo "Converting $f from binary to ASCII STL."
0019 python ../BinaryToASCII.py "$f"
0020 fi
0021
0022 IFS=$'\n'
0023 done
0024
0025
0026 for f in $(find . -name '*_ASCII.stl'); do
0027
0028 unset IFS
0029
0030 if grep -q 'solid' "$f"; then
0031
0032 echo "Converting $f from ASCII STL to .gdml"
0033 python ../stl_gdml.py --x-offset -40.5 --y-offset -427.8 --z-offset 0.0 ../out.gdml "$f"
0034 else
0035 echo "$f is probably a binary STL without ASCII start token solid and should not have the _ASCII.stl name ending."
0036 fi
0037
0038 IFS=$'\n'
0039 done
0040
0041
0042 unset IFS
0043 set +f