Convert all v3 files to binary from ascii where appropriate.

This commit is contained in:
mmcwilliams 2020-08-19 01:14:04 -04:00
parent f636e4127a
commit a0145d462e
1 changed files with 9 additions and 0 deletions

View File

@ -47,6 +47,15 @@ do
facets="N/A"
volume="N/A"
else
firstline=`head -n 1 "$stl"`
if [[ $firstline == solid* ]]; then
#convert from ascii to binary
admesh -c -b "$stl" "$stl"
newSize=`wc -c < "$stl"`
newSize=`echo $newSize | xargs`
percent=`echo "scale=1;($newSize/$fileSize)*100" | bc`
echo "Binary conversion created STL file ${percent}% of original"
fi
ao=`admesh -c "$stl"`
facets=`echo "$ao" | grep "Number of facets" | awk '{print $5}'`
volume=`echo "$ao" | grep "Number of parts" | awk '{print $8}'`