Hobby Hilbert Simplex

https://news.ycombinator.com/rss Hits: 4
Summary

I saw a generative art piece I liked and wanted to learn how it was made. Starting with the artist’s Kotlin code, I dug into three new algorithms, hacked together some Python code, experimented with alternatives, and learned a lot. Now I can explain it to you.It all started with this post by aBe on Mastodon:I love how these lines separate and reunite. And the fact that I can express this idea in 3 or 4 lines of code.For me they’re lives represented by closed paths that end where they started, spending part of the journey together, separating while we go in different directions and maybe reconnecting again in the future.#CreativeCoding #algorithmicart #proceduralArt #OPENRNDR #KotlinThe drawing is made by choosing 10 random points, drawing a curve through those points, then slightly scooching the points and drawing another curve. There are 40 curves, each slightly different than the last. Occasionally the next curve makes a jump, which is why they separate and reunite.Eventually I made something similar:Along the way I had to learn about three techniques I got from the Kotlin code: Hobby curves, Hilbert sorting, and simplex noise.Each of these algorithms tries to do something “natural” automatically, so that we can generate art that looks nice without any manual steps.Hobby curvesTo draw swoopy curves through our random points, we use an algorithm developed by John Hobby as part of Donald Knuth’s Metafont type design system. Jake Low has a great interactive page for playing with Hobby curves, you should try it.Here are three examples of Hobby curves through ten random points:The curves are nice, but kind of a scribble, because we’re joining points together in the order we generated them (shown by the green lines). If you asked a person to connect random points, they wouldn’t jump back and forth across the canvas like this. They would find a nearby point to use next, producing a more natural tour of the set.We’re generating everything automatically, so we can’t manual...

First seen: 2025-10-05 14:01

Last seen: 2025-10-05 17:02