If no admesh, just print N/A

This commit is contained in:
mmcwilliams 2020-06-04 09:46:13 -04:00
parent c4ede152f6
commit 52a9386cf7
4 changed files with 32 additions and 12 deletions

View File

@ -41,9 +41,14 @@ do
size=`wc -c < "${TMP}.stl"`
size=`echo $size | xargs`
ao=`admesh -c "${TMP}.stl"`
if ! [ -x "$(command -v admesh)" ]; then
facets="N/A"
volume="N/A"
else
ao=`admesh -c "$stl"`
facets=`echo "$ao" | grep "Number of facets" | awk '{print $5}'`
volume=`echo "$ao" | grep "Number of parts" | awk '{print $8}'`
fi
line="${VERSION},${CPU},${DATE},${FILENAME},${D},${ROT},100,$size,$facets,$volume,$runtime"
echo $line

View File

@ -34,9 +34,14 @@ do
hash=`sha256sum "$stl" | awk '{ print $1 }'`
fileSize=`wc -c < "$stl"`
fileSize=`echo $fileSize | xargs`
if ! [ -x "$(command -v admesh)" ]; then
facets="N/A"
volume="N/A"
else
ao=`admesh -c "$stl"`
facets=`echo "$ao" | grep "Number of facets" | awk '{print $5}'`
volume=`echo "$ao" | grep "Number of parts" | awk '{print $8}'`
fi
line="${VERSION},${CPU},gnal_${SIZE}_${FILE}.stl,$hash,$fileSize,$srchash,$srcsize,$facets,$volume,$runtime"
echo "$line" >> $NOTES
echo "$line"

View File

@ -38,9 +38,14 @@ do
hash=`sha256sum "$stl" | awk '{ print $1 }'`
fileSize=`wc -c < "$stl"`
fileSize=`echo $fileSize | xargs`
if ! [ -x "$(command -v admesh)" ]; then
facets="N/A"
volume="N/A"
else
ao=`admesh -c "$stl"`
facets=`echo "$ao" | grep "Number of facets" | awk '{print $5}'`
volume=`echo "$ao" | grep "Number of parts" | awk '{print $8}'`
fi
line="${VERSION},${CPU},$stl,$hash,$fileSize,$srchash,$srcsize,$facets,$volume,$runtime"
echo "$line" >> $NOTES
echo "$line"

View File

@ -43,9 +43,14 @@ do
hash=`sha256sum "$stl" | awk '{ print $1 }'`
fileSize=`wc -c < "$stl"`
fileSize=`echo $fileSize | xargs`
if ! [ -x "$(command -v admesh)" ]; then
facets="N/A"
volume="N/A"
else
ao=`admesh -c "$stl"`
facets=`echo "$ao" | grep "Number of facets" | awk '{print $5}'`
volume=`echo "$ao" | grep "Number of parts" | awk '{print $8}'`
fi
line="${VERSION},${CPU},$stl,$hash,$fileSize,$srchash,$srcsize,$facets,$volume,$runtime"
echo "$line" >> $NOTES