aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2016-05-22 18:52:09 +0200
committerAdrian Kummerlaender2016-05-22 18:52:09 +0200
commit2259500ee50ddb17c2e4d6768973dd233d011c29 (patch)
treeefaac28945b0c5dd60f5794af8d478b6892c1eaa
parentacd94fec68d3d207cc05613d0fd3747cd59c9049 (diff)
downloadvoronoi-2259500ee50ddb17c2e4d6768973dd233d011c29.tar
voronoi-2259500ee50ddb17c2e4d6768973dd233d011c29.tar.gz
voronoi-2259500ee50ddb17c2e4d6768973dd233d011c29.tar.bz2
voronoi-2259500ee50ddb17c2e4d6768973dd233d011c29.tar.xz
voronoi-2259500ee50ddb17c2e4d6768973dd233d011c29.zip
Implement script to automatically generate a GIF of the Voronoi-diagrams based on the Minkowski metric for p in [1, 2]
-rw-r--r--unit_circle.sh8
-rw-r--r--voronoi.sh19
2 files changed, 24 insertions, 3 deletions
diff --git a/unit_circle.sh b/unit_circle.sh
index 40c834f..bab9ec6 100644
--- a/unit_circle.sh
+++ b/unit_circle.sh
@@ -1,13 +1,15 @@
#! /usr/bin/fish
-mkdir unit ^/dev/null
-cd unit
+mkdir unit_gif ^/dev/null
+cd unit_gif
rm *.ppm *.gif ^/dev/null
../unit_circle
for f in unit_circle_*
- convert $f -annotate +75+120 (echo "p =" (echo $f | grep -o "[0-9].[0-9]\{2\}" | head -n 1)) $f
+ convert $f -annotate +75+120 (
+ echo "p =" (echo $f | grep -o "[0-9].[0-9]\{2\}" | head -n 1)
+ ) $f
end
convert -delay 8 -loop 0 *.ppm circle.gif
diff --git a/voronoi.sh b/voronoi.sh
new file mode 100644
index 0000000..6d904a8
--- /dev/null
+++ b/voronoi.sh
@@ -0,0 +1,19 @@
+#! /usr/bin/fish
+
+mkdir voronoi_gif ^/dev/null
+cd voronoi_gif
+rm *.ppm *.gif ^/dev/null
+
+../voronoi
+
+for f in voronoi_*
+ convert $f -annotate +450+500 (
+ echo "p =" (echo $f | grep -o "[0-9].[0-9]\{2\}" | head -n 1)
+ ) $f
+end
+
+convert -delay 4 -loop 0 *.ppm voronoi.gif
+convert -reverse voronoi.gif voronoi_reversed.gif
+convert voronoi.gif voronoi_reversed.gif voronoi_cycle.gif
+
+cd ..