Tools Used: DrawSVG, e
Musings, ramblings, rantings about technology, games, puzzles, and whatever else catches my attention.
Tools Used: DrawSVG, e
The prompt says "Use an API (e.g. the weather)". I could have cheesed this one by claiming that my use of any of the APIs to my libraries (e.g. drawSVG, Pillow) counted.
Instead, I used the Washington State Department of Transportation (WSDOT) Ferry Schedule REST API, which I feel was closer in line to what the intent of the prompt was.
I fetched the ferry routes, decoded the sailing times for 19 different ferry terminals. In some cases, I had both departure and arrival times, other times, I just had the departure time, so I assumed the crossing time was 30 minutes.
I manually sorted the cities to make things make the most sense (to me) - Bainbridge Island / Seattle / Bremerton are the first three lines, then Edmonds/Kingston. For some reason, I have no sailing data for today for Edmonds/Kingston. I know there was a logging truck that spilled some logs a few days ago:
https://www.seattletimes.com/seattle-news/transportation/log-spill-blocks-edmonds-ferry-dock-monday-afternoon/
This feels more like an infographic, or just a "graph" than a piece of art, though the shapes for the San Juan Island ferries (bottom of the image) are pretty nuts.
Tools Used: DrawSVG, WSDOT REST API
Tools Used: Pillow (the Python image library, forked off of PIL)
Trees! Who doesn't love trees! So many fractally things to do with trees. Like L-systems! Or fractals that look kind of like trees!
I decided to explore an algorithm I wasn't super familiar with, and whose output I didn't entirely like, and whose name I didn't entirely like. I chose the "Space Colonization" algorithm, which I saw on Coding Train: https://youtu.be/kKT0v3qhIQY
The basic idea is that you generate a pattern of "attractors" (referred to as "leaves" in the Coding Train video, but that's an error), and you grow your network of branches in the direction of the attractors. Each attractor exerts a "pull" on its closest tree branch node, and nodes with more than zero pulls branch off a new branch in the direction of the net pull. Add in some thresholds so that attractors shut off when a tree branch gets close enough, and you've got a pretty straightforward algorithm.
And, indeed, I got something working right away, but it wasn't fast enough for me. So I added quadtrees - which I realized, after I had them implemented and debugged, were more TREES. So, that's even better. There's a LOT of "find the closest <x> to the position of each <y>" going on in this algorithm, so having a spatial data structure to accelerate that made sense.
Giddy off of using spatial distance functions, I added SDFs to my quadtree implementation. There were two big queries that I did into my quadtrees:
Tools Used: Pentel pen, printer paper, AxiDraw Mini
One of the first two places my brain went when I was considering "Interference Patterns" was the double slit photon experiment, and the simpler version of that that we did in high school physics (shout out to Mr. Pearson, my physics teacher, and Troy and Becky, my lab partners). The simpler version was done in a shallow basin of water, with two periodic ripple generators. It's pretty much what's explained here: https://www.physicsclassroom.com/class/light/Lesson-1/Two-Point-Source-Interference
The other thought I had was some sort of Moiré pattern: https://en.wikipedia.org/wiki/Moir%C3%A9_pattern
So, I made two drawable objects, one which made an expanding ripple pattern, and one which made a rotating starburst of rays. I made two of each, and put all of the drawables on their own lissajous curves (which feels sort of interference-y in a different way; complex motion from two sine waves not in sync).
I drew a bunch of frames of this, which I made an animated GIF of, and the above YouTube video, and I also drew one frame out on my AxiDraw. I don't know how easily consumed each is - I like to think that the best version of this is the animated GIF, but the others are probably more accessible.
Do some code golf! How little code can you write to make something interesting? Share the sketch and its code together if you can.
I pushed myself to make something small, but without taking a lot of time to make it smaller than my first working version. I started with a version that just printed a string to the console:
600 small spiders, each with left/right symmetry of the pose of their legs.
I've wanted to draw something based on a spiral on my AxiDraw for a bit, so here we are.
For each spider, I generate a list of four numbers [-1, 1] that describe how "forward" one leg is. I then use that for both left and right legs to draw lines for the legs. I was thinking that I'd randomly let some spiders be L/R symmetric, others be rotationally symmetric, but the rotation code didn't work the first time, so rather than debug it, I just fell back to L/R symmetry.
The spiral is a simple archimedean spiral: r = k * theta, but I'm trying to take steps of roughly uniform distance along that spiral, so my step in theta is based on figuring out the radius of a circle going through the current point, and dividing a target step distance by that. This math was hard for Monday morning brain.
I started drawing this on the AxiDraw Mini, and estimated that each spider took around 4 seconds to draw, which didn't feel like a lot, but there are a lot of spiders, so I added a counter to my spider drawing loop, which counted 600 spiders exactly, which is unexpected.
I've been drawing on normal printer paper, folded over four ways to fit on my AxiDraw Mini, which sometimes led to the paper bowing upward during the print. This time, I ripped the paper down to 4.25" x 5.5", which reduced bowing. I think the better solution will be to get some drawing paper, which will have a more interesting texture and a little more thickness.
I should also try to draw to a smaller region; this image is 15cm x 10cm as generated, but my AxiDraw Mini drew off the edge of the paper, bumped into the binder clips, and drew off the edge of the board. So, maybe 12cm x 10cm next time.
Tools Used: AxiDraw Mini, InkScape, DrawSVG
Languages Used: Python3
Development Time: ~60 minutes
Plotting Time: ~60 minutes
What's Generative Here: for each spider, for each leg, that leg's pose is generated using a random number generator
Maybe I'll call this "84 Little Computer Friends"
I was kind of dreading this prompt, as humans are complex and difficult to draw. So, with thanks to Randall Munroe and Rich Burlew, I set out to draw a bunch of simple humans. I've got an idea for a picture I want to render someday of a hundred, a thousand superheroes, all just standing around. This is not that picture. Or maybe it is. Well, no.I used the Python drawSvg library to draw this image as a SVG, and then I used the AxiDraw to draw the SVG from within InkScape. The pen-and-ink version lost the racial diversity in the original image, which might be a theme. If you want.
Each stick figure has their own proportions, based around an average stick figure that I drew on some graph paper.
Tools Used: AxiDraw Mini, InkScape, DrawSVG
Languages Used: Python3 (SVG?)
Development Time: ~90 minutes
What's Generative Here: each stick figure's proportions, pose, and skin tone are generated using a random number generator
