Friday, July 31, 2020

Day 141, back-dated


 

Day 140

Now, instead of twirling around a central point, it spins around a small interior circle.

This meant I had to plot coordinates with sin and cos.  Which you can do in bash, but only by calling bc and capturing the output.  I'm thinking that maybe bash wasn't the best choice of languages.

Thursday, July 30, 2020

Day 140, back-dated


 

Day 139

The text is now centered on the page, but with the slew incrementing, so it rotates around its center point.


Monday, July 27, 2020

Numbers again



Mary wanted me to keep experimenting.  So I checked the script into source control and kept going.

First off was to change the "draw" command to "annotate".  It's newer and supposed to be more powerful.  It's also easier to code, because it doesn't need quotes that you have to escape.  Then I added "-gravity center" and adjusted the x and y positions until I got something that fit on the canvas.

Day 137, back-dated


 

Thursday, July 23, 2020

bash/imagemagick 'sketch'

A challenge from Mary last week, to come up with a work of art to portray the 124 days that we'd been in lock-down.
And the code thereto:

#!/bin/bash
declare -a ones=("" One Two Three Four Five Six Seven Eight Nine)
declare -a tens=("" Teen Twenty Thirty Forty Fifty Sixty Seventy Eighty Ninety)
declare text

function doOnes {
    text=${ones[$1]}
}

function doTens {
    case $1 in
        1)
            case $text in
                "")      text=Ten ;;
                "One")   text=Eleven ;;
                "Two")   text=Twelve ;;
                "Three") text=Thirteen ;;
                "Five")  text=Fifteen ;;
                *)       text=$text"teen" ;;
            esac
            ;;

        *)
            text=${tens[$1]}" "$text
            ;;
    esac
    
}

function doHundreds {
    text=${ones[$1]}" Hundred "$text
}

function makeText {
    reversed=$( printf $1 | rev )
    for x in $( seq 0 $((${#reversed} - 1)) ); do
        digit=$(( ${reversed:${x}:1} ));
        case $x in
            0) doOnes $digit ;;
            1) doTens $digit $text ;;
            2) doHundreds $digit $text ;;
        esac
    done
}
        
cmd="convert -size 1500x1020 xc:ivory"

for i in $( seq 1 124 ); do
    makeText $i
    pointsize=" -pointsize "$((200-$i))
    color=" -fill rgb\("$((2*$i))",25,"$((255-$(($i*2)) ))",0.001\)"
    stroke=" -stroke black"
    x=$(( 10 + $(($i*3)) ))
    y=$(( 140 + $(($i*7)) ))
    draw=" -draw \"text "$x","$y" '"$text"'\""
    cmd=$cmd$pointsize$color$stroke$draw
done
cmd=$cmd" xxx.gif"

eval $cmd
display xxx.gif&

Day 133, back-dated


 

Saturday, July 18, 2020

Day 128, back-dated


 

Virtual sketchcrawl - your favorite green space

Deb had proposed to set today's virtual sketchcrawl in 'your favorite (separated) park'.  And I spent some time in trying to figure out which park was my favorite.  Well, now, there's no debate at all, it's Forest Park.  But I'm not heading up the narrow trails anymore, and don't feel safe lingering in one spot, even on Leif Erickson.  Then I re-read the post, and realized that she'd written 'your favorite green space'.  And my favorite is, hands down, my own yard, where I often hang out with a cat or a dog.  And lately, my favorite activity has been the daily berry hunt.  


So I sat down in my backyard and sketched some of my cane raspberries (almost done), strawberries (only the ever-bearing ones are left, coming ripe in ones and twos) and blueberries (about a week into the season).






There are others that I didn't get to.  Thimbleberries are tiny and hardly worth picking, but they're pretty.  My creeping raspberries were planted as a ground cover.  But I found that I liked the fruit.  My huckleberries are likewise small and hardly worth picking.  Moreover, I don't think they're read yet.  The salal is full of seeds and not very sweet, so I usually leave it for the birds.  And, finally, my oregon grape got wiped out by the oak tree.  It's coming back up from the roots though, so I'll have it again.  I found one stalk that somehow survived the desolation, and produced a half a dozen berries.