Use ADMesh to calculate facets and volume of resulting models. Look for significant differences in render time and size between spiral approaches.

main
mmcwilliams 3 years ago
parent 5f592661ba
commit c677099742
  1. 31
      scripts/benchmark.sh
  2. 7
      scripts/v1.sh

@ -5,11 +5,13 @@ CPU=`bash ./scripts/cpu.sh`
DATE=`date -u +%s` #timestamp in seconds
NOTES="./notes/benchmark.csv"
ROTATIONS=( 1 2 5 10 20 )
DIAMETERS=( 47 225 300 )
ROTATIONS=( 1 2 ) # 5 10 20 )
DIAMETERS=( 47 ) # 225 300 )
COMPLETE=( 40 60 )
echo "version,cpu,date,source,diameter,rotations,$fn,size,time" > $NOTES
mkdir -p benchmark
echo "version,cpu,date,source,diameter,rotations,fn,size,facets,volume,time" > $NOTES
for SPIRAL in ./spiral/*.scad
do
@ -22,19 +24,23 @@ do
do
:
echo "Rendering ${SPIRAL} for ${ROT} rotations @ ${D}mm"
TMP=`mktemp`
#TMP=`mktemp`
TMP="benchmark/${FILENAME}_${D}_${ROT}_100"
start=`date +%s`
openscad -o "${TMP}.stl" -D N=${ROT} -D D=${D} -D FN=100 "${SPIRAL}"
end=`date +%s`
runtime=$((end-start))
size=`wc -c < "${TMP}.stl"`
size=`echo $size | xargs`
ao=`admesh -c "${TMP}.stl"`
facets=`echo "$ao" | grep "Number of facets" | awk '{print $5}'`
volume=`echo "$ao" | grep "Number of parts" | awk '{print $8}'`
line="${VERSION},${CPU},${DATE},${FILENAME},${D},${ROT},100,$size,$runtime"
line="${VERSION},${CPU},${DATE},${FILENAME},${D},${ROT},100,$size,$facets,$volume,$runtime"
echo $line
echo $line >> $NOTES
rm "${TMP}.stl"
#rm "${TMP}.stl"
done
done
@ -42,12 +48,21 @@ do
do
:
echo "Rendering complete ${SPIRAL} with ${C} rotations"
TMP=`mktemp`
#TMP=`mktemp`
TMP="benchmark/${FILENAME}_${D}_${ROT}_100"
start=`date +%s`
echo -o "${TMP}.stl" -D N=${C} -D D=47 "${SPIRAL}"
end=`date +%s`
runtime=$((end-start))
echo "${TMP}.stl"
size=`wc -c < "${TMP}.stl"`
size=`echo $size | xargs`
ao=`admesh -c "${TMP}.stl"`
facets=`echo $ao | grep "Number of facets" | awk '{print $5}'`
volume=`echo $ao | grep "Number of parts" | awk '{print $8}'`
line="${VERSION},${CPU},${DATE},${FILENAME},${D},${ROT},100,$size,$facets,$volume,$runtime"
#echo $line >> $NOTES
echo $line
#rm "${TMP}.stl"
done

@ -11,7 +11,7 @@ SIZES=( "50ft" "100ft" )
mkdir -p $DIST
echo "version,cpu,file,file_hash,file_size,source_hash,source_size,render_time" > $NOTES
echo "version,cpu,file,file_hash,file_size,source_hash,source_size,facets,volume,render_time" > $NOTES
for SIZE in "${SIZES[@]}"
do
@ -32,7 +32,10 @@ do
hash=`sha256sum "${DIST}/${SIZE}_v1/gnal_${SIZE}_${FILE}.stl" | awk '{ print $1 }'`
fileSize=`wc -c < "${DIST}/${SIZE}_v1/gnal_${SIZE}_${FILE}.stl"`
fileSize=`echo $fileSize | xargs`
line="${VERSION},${CPU},gnal_${SIZE}_${FILE}.stl,$hash,$fileSize,$srchash,$srcsize,$runtime"
ao=`admesh -c "${DIST}/${SIZE}_v1/gnal_${SIZE}_${FILE}.stl"`
facets=`echo $ao | grep "Number of facets" | awk '{print $5}'`
volume=`echo $ao | grep "Number of parts" | awk '{print $8}'`
line="${VERSION},${CPU},gnal_${SIZE}_${FILE}.stl,$hash,$fileSize,$srchash,$srcsize,$facets,$volume,$runtime"
echo "$line" >> $NOTES
echo "$line"
done

Loading…
Cancel
Save