The random_seed parameter does not produce the desired effects. Creates different files even though they share the same random_seed.

This commit is contained in:
Matt McWilliams 2023-04-05 20:07:57 -04:00
parent aae4fbe763
commit 85bcc06ea0
3 changed files with 42 additions and 0 deletions

View File

@ -75,5 +75,29 @@ 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

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);
}