Use local size.sh script with cross-platform support
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 77 KiB After Width: | Height: | Size: 71 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 59 KiB |
|
@ -16,7 +16,7 @@ do
|
||||||
FILES=./stl/${SIZE}_${VERSION}/*.stl
|
FILES=./stl/${SIZE}_${VERSION}/*.stl
|
||||||
for stl in $FILES
|
for stl in $FILES
|
||||||
do
|
do
|
||||||
fileSize=`wc -c < "$stl"`
|
fileSize=`bash ./scripts/size.sh "$stl"`
|
||||||
fileSize=`echo $newSize | xargs`
|
fileSize=`echo $newSize | xargs`
|
||||||
|
|
||||||
firstline=`head -n 1 "$stl"`
|
firstline=`head -n 1 "$stl"`
|
||||||
|
@ -24,7 +24,7 @@ do
|
||||||
echo "Converting $stl to binary..."
|
echo "Converting $stl to binary..."
|
||||||
#convert from ascii to binary
|
#convert from ascii to binary
|
||||||
admesh -c -b "$stl" "$stl"
|
admesh -c -b "$stl" "$stl"
|
||||||
newSize=`wc -c < "$stl"`
|
newSize=`bash ./scripts/size.sh "$stl"`
|
||||||
newSize=`echo $newSize | xargs`
|
newSize=`echo $newSize | xargs`
|
||||||
percent=`echo "scale=1;($newSize/$fileSize)*100" | bc`
|
percent=`echo "scale=1;($newSize/$fileSize)*100" | bc`
|
||||||
#fileSize="${newSize}"
|
#fileSize="${newSize}"
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
FILE="$1"
|
||||||
|
|
||||||
|
if [ "$FILE" = "" ]; then
|
||||||
|
echo -1
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
#wc -c < "$FILE"
|
||||||
|
#exit 0
|
||||||
|
|
||||||
|
if [ "$(uname)" == "Darwin" ]; then
|
||||||
|
# Mac OS X platform
|
||||||
|
stat -f%z "${FILE}"
|
||||||
|
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
|
||||||
|
# GNU/Linux platform
|
||||||
|
stat -c%s "${FILE}"
|
||||||
|
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
|
||||||
|
# 32 bits Windows NT platform
|
||||||
|
echo -1
|
||||||
|
exit 2
|
||||||
|
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
|
||||||
|
# 64 bits Windows NT platform
|
||||||
|
echo -1
|
||||||
|
exit 3
|
||||||
|
fi
|