Saturday, January 9, 2021

Genuary 2021 Day 8 (completed one day late) "Curve Only"

 


I had a lot of ideas about how to approach this prompt. I ended up writing only half as much code as I intended to, but it came out really well. I have ideas of where I would like to revisit and expand, but once I saw this, I decided to step away, plot it, and call it good.

I'm going to call this a "flow field" drawing, but there may be other technical terms for it - I remember seeing drawings like this as I was learning Differential Equations.

First thing I did was to generate an irregular grid of points using Bridson's algorithm (see http://extremelearning.com.au/an-improved-version-of-bridsons-algorithm-n-for-poisson-disc-sampling/ and https://www.cs.ubc.ca/~rbridson/docs/bridson-siggraph07-poissondisk.pdf for fast blue noise random grid generation). For each point, I generated a unit vector in a random 2d direction. I then did 10 iterations of smoothing, letting each vector be replaced by a normalized sum of the vectors within 60 units. I called this smoothed set of vectors my "flow grid". Or, you could consider it the velocity as a function of position.

I wrote a function to sample this flow grid, not just at the grid points, but averaging over all the points within a radius. Here, 40 units. I then started a path at each of my initial grid points, stepping in the direction of the flow grid for up to 100 steps, or until I ran off the page.

I count 4 "whorls" that would attract the pen and never release it. I think if I draw more works in this style, I'll do a "capture detection" or density limit. For "capture detection", I'd check to see if the pen has spent the past <n> steps within <m> radius. If the pen has been captured, stop drawing the line. For "density limit", I'd keep a record of points along the path. If there are more than <n> points already drawn withing <m> radius of the pen, stop drawing the line. This would also decrease the likelihood of having a lot of parallel paths overlapping too near to each other. Both of these would change the look of the finished work a little - I'd want to try a few values to see if I like what I come up with.

Other experiments I'd like to try:

  • generate the position grid and flow grid, as described above, but when drawing, choose a subset of the page to use as path starts. Maybe points left of a line - it occurred to me that if you have a "horizon"  below one of the whorls, you might draw something like Hokusai's "Great Wave off Kanagawa". Another thing to try would be to try only starting from points within a circle.
  • draw fewer lines, but for each start point, draw several lines with an angular offset from the flow grid. This would lead to some interesting spiraling curves, I suspect.
  • multiple colored pens - I'd want to generate a couple different SVGs, and then swap pens to make the next layer.

Tools Used: Pentel pen, printer paper, AxiDraw Mini

Languages Used: Python

Development Time: ~2 hours over two days (hard time sleeping. I blame insurrectionists.)

Drawing Time: ~105 minutes

What's Generative Here: The position grid is generated randomly using a blue noise algorithm. For each node in  the position grid, I generate a "flow" vector of unit length and random direction. I then proceed to "smooth" this flow grid by averaging flow vectors with their neighbors. The colors in the SVG are selected by starting with red, and then adding a fixed amount of red, green, and blue, wrapping around when out of gamut, for each path. This is intended to give a coverage of the RGB space, a little like sunflowers use 1/phi for each successive petal, leading to golden ratio spirals.















No comments:

Post a Comment