diff --git a/deterministic_tests.sh b/deterministic_tests.sh index 6ba75ef..93f5cd5 100644 --- a/deterministic_tests.sh +++ b/deterministic_tests.sh @@ -101,3 +101,28 @@ rm -rf "${RANDOM_SEED}" #--export-format asciistl #--export-format binstl + +############## +# SORT-STL vs. C14N +############## + +echo "sort-stl..." + +SORTSTL=$(mktemp -d) +FIRST="${SORTSTL}/first.stl" +SECOND="${SORTSTL}/second.stl" + +openscad -q -o "${FIRST}" --enable sort-stl scad/deterministic.scad +openscad -q -o "${SECOND}" scad/deterministic2.scad +python3 python/c14n_stl.py "${SECOND}" + +DIFF_VAL=$(diff "${FIRST}" "${SECOND}") + +if [[ "${DIFF_VAL}" == "" ]]; then + echo "Files are the same" +else + #echo "${DIFF_VAL}" + echo "Files are different" +fi + +rm -rf "${SORTSTL}" \ No newline at end of file