Compare commits

...

2 Commits

3 changed files with 67 additions and 0 deletions

View File

@ -75,5 +75,54 @@ fi
rm -rf "${C14N}"
##############
# RANDOM_SEED
##############
echo "random_seed..."
RANDOM_SEED=$(mktemp -d)
FIRST="${RANDOM_SEED}/first.stl"
SECOND="${RANDOM_SEED}/second.stl"
openscad -q -o "${FIRST}" scad/deterministic_random_seed.scad
openscad -q -o "${SECOND}" scad/deterministic_random_seed2.scad
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 "${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}"

View File

@ -0,0 +1,9 @@
$fn = 100;
random_seed=1337;
difference () {
cube([40, 40, 40], center = true);
cylinder(r = 20/2, h = 40 + 1, center = true);
rotate([90, 0, 0]) cylinder(r = 20/2, h = 40 + 1, center = true);
rotate([0, 90, 0]) cylinder(r = 20/2, h = 40 + 1, center = true);
}

View File

@ -0,0 +1,9 @@
$fn = 100;
random_seed=1337;
difference () {
cube([40, 40, 40], center = true);
rotate([0, 90, 0]) cylinder(r = 20/2, h = 40 + 1, center = true);
rotate([90, 0, 0]) cylinder(r = 20/2, h = 40 + 1, center = true);
cylinder(r = 20/2, h = 40 + 1, center = true);
}