From a0145d462e879580e17bd5e13a3c5a995962bea6 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Wed, 19 Aug 2020 01:14:04 -0400 Subject: [PATCH] Convert all v3 files to binary from ascii where appropriate. --- scripts/v3.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/v3.sh b/scripts/v3.sh index 414cce7..ff2f9c9 100644 --- a/scripts/v3.sh +++ b/scripts/v3.sh @@ -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}'`