From bd72e29c051fe53a5d493e17bfd42a94472a3994 Mon Sep 17 00:00:00 2001 From: mattmcw Date: Thu, 16 Sep 2021 10:42:59 -0400 Subject: [PATCH] Add comments to all scripts. --- draw.sh | 16 +++++++++------- field.sh | 22 ++++++++++++++++++++++ position.sh | 7 +++++++ seq.sh | 7 +++++++ stipple.sh | 13 ++++++++++--- test.sh | 11 ----------- topleft.sh | 8 ++++++++ white.sh | 10 ++++++++++ 8 files changed, 73 insertions(+), 21 deletions(-) create mode 100644 field.sh delete mode 100644 test.sh diff --git a/draw.sh b/draw.sh index aa94915..951ee3b 100644 --- a/draw.sh +++ b/draw.sh @@ -1,5 +1,13 @@ #!/bin/bash +########################### +# +# Draws all svgs in a sequence. Starts with a +# fieldguide unless beginning the sequence not +# on the first frame, provided as the second argument. +# +########################### + askContinue () { echo "Are you ready to continue? (yes/no)" read input @@ -18,13 +26,7 @@ fi if [ "${2}" == "" ]; then name=`basename "${1}"` - bash position.sh set - ax guides/guide_all.svg - number=`mktemp`.svg - node ./numbers/ -n "${name}" -o "${number}" - ax "${number}" - rm -f "${number}" - bash position.sh reset + bash field.sh "${name}" askContinue "Starting with first frame..." else diff --git a/field.sh b/field.sh new file mode 100644 index 0000000..14723d5 --- /dev/null +++ b/field.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +########################### +# +# Draws a field guide to test pen position +# or begin a sequence. +# +########################### + +name=test + +if [[ "${1}" != "" ]]; then + name="${1}" +fi + +bash position.sh set +ax guides/guide_all.svg +number=`mktemp`.svg +node ./numbers/ -n "${name}" -o "${number}" +ax "${number}" +rm -f "${number}" +bash position.sh reset \ No newline at end of file diff --git a/position.sh b/position.sh index 6f82408..0e3926d 100644 --- a/position.sh +++ b/position.sh @@ -1,5 +1,12 @@ #!/bin/bash +########################### +# +# Position the pen at an offset for a frame +# and resets the pen after it is complete. +# +########################### + XZIG=2.0 X=3.35 #4.2 - XZIG Y=1.93 diff --git a/seq.sh b/seq.sh index 6c577e8..4c86184 100644 --- a/seq.sh +++ b/seq.sh @@ -1,5 +1,12 @@ #!/bin/bash +########################### +# +# Export a video to an image sequence at a +# particular framerate. +# +########################### + MULTIPLE=2 RATE=`echo "scale=0;24/${MULTIPLE}" | bc` diff --git a/stipple.sh b/stipple.sh index 77c6374..9d265ef 100644 --- a/stipple.sh +++ b/stipple.sh @@ -1,5 +1,13 @@ #!/bin/bash +########################### +# +# Run the stipple_gen script on a sequence +# of PNG images and then render the resulting +# preview images into a video. +# +########################### + if [[ "${1}" == "" ]]; then echo "Please provide a directory of images as the first argument" exit 1 @@ -16,8 +24,7 @@ fi mkdir -p "${OUTPUT}" - - +FRAMERATE=12 WIDTH=404 HEIGHT=374 DOTSIZE=4 @@ -75,6 +82,6 @@ for png in "${INPUT}/"*.png ; do fi done -ffmpeg -y -r 12 -f image2 -i "${IMAGES}" \ +ffmpeg -y -r ${FRAMERATE} -f image2 -i "${IMAGES}" \ -c:v prores_ks -profile:v 3 \ "${VIDEO}" diff --git a/test.sh b/test.sh deleted file mode 100644 index 593a256..0000000 --- a/test.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -name=test - -bash position.sh set -ax guides/guide_all.svg -number=`mktemp`.svg -node ./numbers/ -n "${name}" -o "${number}" -ax "${number}" -rm -f "${number}" -bash position.sh reset \ No newline at end of file diff --git a/topleft.sh b/topleft.sh index 59bc164..b314259 100644 --- a/topleft.sh +++ b/topleft.sh @@ -1,5 +1,13 @@ #!/bin/bash +########################### +# +# Place a dot at the top left-most +# point at the point the position script +# starts the pen. +# +########################### + bash position.sh set paxi down sleep 1 diff --git a/white.sh b/white.sh index e7e6682..38aac31 100644 --- a/white.sh +++ b/white.sh @@ -1,3 +1,13 @@ +#!/bin/bash + +########################### +# +# Centers an image in a white frame. +# Used for creating SVG files with a +# "natural" offset. +# +########################### + WIDTH=404 HEIGHT=374