Live data from Hacker News

What I've learned about flow fields so far

damoonrashidi.me

11–20 of 47 posts

Re: What I've learned about flow fields so far

#11
post #2

I wrote an article on the basics of Flow Fields in the context of Generative Art (no AI stuff, just for loops and if cases). It has some fun interactive illustrations and code samples for anyone looking to get into the field.

Really nice, I love the interactive explanations. We covered flow fields in a chapter for the second edition of our book 'Coding Art' [0]. We use p5.js to match the earlier Processing parts in the book. Btw, Tyler's page is referenced, but yours will be in a future edition. Thanks for writing this up!

[0] https://codingart-book.com

Re: What I've learned about flow fields so far

#13

Nice! Could this be loosely related to neural cellular automata? https://youtu.be/3H79ZcBuw4M?si=-B7RRoz2RdVgkz6p

I'm not an expert but as far as I can see the overlap is "only" that they both use a grid to propagate values through. Which admittedly is a pretty fundamental way to structure things. The high-level concepts seem quite different otherwise.

I suspect you could encode (some) flow fields in neural cellular automata though. "Some" because "flow fields" aren't too strictly defined I'd say, so some of the more creative variations might not quite fit within the constraints of neural cellular automata.

So I guess it depends on the angle from which you approach it. Probably not from the "default" angles that most people use for either topic. OTOH finding an unexpected connection by looking at both in a non-obvious way might be fruitful though!

Re: What I've learned about flow fields so far

#14

Nice! Playing around with the widget under the section "Experimenting with lines" I'm reminded of Bret Victor's Inventing on Principle talk [0] (an absolute must watch, if anyone hasn't yet). In particular, changing the smoothness reveals a sort of scaling effect that I'd probably never know about if not playing around with sliders and having it update in real time rather than setting individual values. Very interest…

I haven't seen that talk yet but will for sure watch it tonight!

Re: What I've learned about flow fields so far

#16
post #12

For collision detection using screen space might be easier, i.e. instead of looking for collisions between lines one wants to draw analytically, just try to draw them and check if all the pixels are background pixels.

Great point! Unfortunately I do most of these generative art experiments as SVGs to feed to an axidraw machine (https://shop.evilmadscientist.com/productsmenu/846), but gut feeling says that in these canvas examples where sampling screen colors is possible your suggested method would be faster, and much more so for smaller lines and if the canvas is big.

I'll try to make an edit to the article where I try it out when I'm off work.

Thanks for the tip!

Re: What I've learned about flow fields so far

#17
post #4

This is awesome! I noticed on the 'Experimenting with lines' section, when smoothness is low, warp is high and length is high, that the lines end up mostly coalescing into big roads. It reminded me of ants forming paths, but it's interesting that this required no communication between the lines. Is this a particular feature of the noise function or does it always do that?

This is how I think about the ant like paths: Since we're warping the angles lines that turn a little will turn more, and lines that turn almost nothing will continue turning very little. Lines will start to converge against points that turn very little, after which all lines are grouped up and all go through the same points. I.e. turn until the turn-vector is small. That only happens when the smoothing is low, since the difference in noise values will still be high enough to cause this effect.

I don't know it that mess of a paragraph was understandable, but hopefully it answers your question!

Re: What I've learned about flow fields so far

#18
As a trained physicist, it's weird to see such "unnatural", ad hoc fields used. I have the feeling that using a fluid dynamics solver might generate more realistic looking fields. One issue with the smoothing is that it introduces a discontinuous correlation function. When you crank down smoothing, you can see this artifact as horizontal lines that get closer and closer together as smoothing is lowered. Simulated fluid flow with a few sources, sinks would mean there's no need for ad hoc smoothing.

Re: What I've learned about flow fields so far

#19
post #16
post #12

For collision detection using screen space might be easier, i.e. instead of looking for collisions between lines one wants to draw analytically, just try to draw them and check if all the pixels are background pixels.

Great point! Unfortunately I do most of these generative art experiments as SVGs to feed to an axidraw machine ( https://shop.evilmadscientist.com/productsmenu/846 ), but gut feeling says that in these canvas examples where sampling screen colors is possible your suggested method would be faster, and much more so for smaller lines and if the canvas is big. I'll try to make an edit to the article where I try it out wh…

SVG also has functions for hit testing [1][2] but I have no experience or at least memories of using them. So no idea if they could be useful and performant enough. But given that interactive SVGs might require finding the object under the mouse cursor as it moves, I would expect this to be reasonable performant, but it might of course still be too slow when used while drawing hundreds or thousands of objects.

[1] https://developer.mozilla.org/en-US/docs/Web/API/SVGGeometry...

[2] https://developer.mozilla.org/en-US/docs/Web/API/SVGGeometry...

Re: What I've learned about flow fields so far

#20

As a generative artist, I experimented with flow fields for a while but found them rather limited, especially given how many people use them. It's hard to distinguish yourself if you do what everyone else is doing.

Yeah, I guess it’s probably hard to stand out with flow fields since you have really famous gen artists like Tyler Hobbs using them quite heavily. What have you found to be less limiting or more expressive? Other expressions of noise?
Post reply on HN