Fortraneries/Fraktalism/plotpick.sh

73 lines
1.0 KiB
Bash
Raw Permalink Normal View History

2022-02-16 10:18:35 +11:00
#!/bin/bash
ASCFILE="nuage.asc"
2022-03-08 20:36:32 +11:00
IMAGE="pickplot.png"
2022-02-16 10:18:35 +11:00
make pickover
if [ $? -ne 0 ] ; then
echo
echo "Make error " $?
exit 1
fi
./pickover foo.pgm > $ASCFILE
if [ $? -ne 0 ] ; then
echo
echo "Pickover error " $?
exit 1
fi
2022-02-16 22:15:30 +11:00
# ----------------------------------------------------
function plot_this_pic()
{
local imgname="$1"
local angle="$2"
printf "== %s == %3d ==\n" $imgname $angle
2022-02-16 10:18:35 +11:00
gnuplot << __EOC__
2022-03-08 20:36:32 +11:00
set term png size 1024,768
2022-02-16 22:15:30 +11:00
set output "${imgname}"
2022-02-16 10:18:35 +11:00
2022-02-16 22:15:30 +11:00
set title "3D Pickover"
unset grid
unset tics
2022-02-16 10:18:35 +11:00
2022-02-16 22:15:30 +11:00
set view 70, $angle, 1.20
set xrange [ -2.10 : 2.10 ]
set yrange [ -2.10 : 2.10 ]
set zrange [ -1.00 : 1.00 ]
2022-02-16 10:18:35 +11:00
2022-02-16 22:15:30 +11:00
splot "${ASCFILE}" notitle with dots lt rgb "blue"
2022-02-16 10:18:35 +11:00
__EOC__
2022-02-16 22:15:30 +11:00
}
# ----------------------------------------------------
ddir="frames"
rm $ddir/p???.png
idx=0
2022-02-23 13:02:19 +11:00
for angle in $(seq 0 5 360)
2022-02-16 22:15:30 +11:00
do
fname=$(printf "%s/p%03d.png" $ddir $idx)
plot_this_pic $fname $angle
idx=$(( idx + 1 ))
done
convert -delay 10 $ddir/p???.png pickover.gif
echo '[done]'
# ------------------------------------------ EOJ -----
2022-02-16 10:18:35 +11:00