还没有账号去注册
动画脚本如下:
#!/bin/bash
set -eu
DIR="animate"
FILE="Federpendel"
NUM=0
rm -f ${DIR}/frame???.png
for ANG in $(seq 0 10 359) ; do
echo "Creating frame $NUM ..."
POS=$(echo "-3+0.8*c($ANG/45*a(1))" | bc -l)
echo $POS $ANG
sed -i "s/\\\def\\\myx{.\+}/\\\def\\\myx{$POS}/" ${FILE}.tex
pdflatex -shell-escape ${FILE}.tex 1> /dev/null
echo "Convert to png ..."
NUMSTR=$(printf "%03d" $NUM)
convert -density 256 ${FILE}.svg -shave 3 ${DIR}/frame${NUMSTR}.png
NUM=$(($NUM+1))
done
cd $DIR
convert -delay 10 -loop 10000 frame*.png Federpendel.gif
cd -
效果图:
https://commons.wikimedia.org/wiki/File:FederpendelRuhelage.svg
暂无评论