From 2259500ee50ddb17c2e4d6768973dd233d011c29 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sun, 22 May 2016 18:52:09 +0200 Subject: Implement script to automatically generate a GIF of the Voronoi-diagrams based on the Minkowski metric for p in [1, 2] --- unit_circle.sh | 8 +++++--- voronoi.sh | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 voronoi.sh 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 .. -- cgit v1.2.3