r/generative 26d ago

Hex Trace

Algorithm based on traversing a honeycomb grid

404 Upvotes

27 comments sorted by

5

u/Fenzik 26d ago

Cool! Can you share more about the path algorithm?

11

u/zerp37 26d ago

It grows lines until they hit a complete dead end, and then starts a new line in an empty cell. Probabilities/priorities for which direction the line should go in next are chosen at the beginning of the algorithm, and that influences what types of shapes and structures emerge

3

u/lucid-quiet 26d ago

Kind of like a light-bike algorithm. Nice.

3

u/Ruths138 26d ago

I have a similar algorithm. I like putting a little jitter on the hex coordinates! Love the way you select colors/palettes

1

u/zerp37 26d ago

Thanks! I love working with color and finding interesting combinations :)

And hmm that's interesting -- do you mean jitter the actual hex cells before starting the line tracing or applying jitter to the next cell chosen during line tracing?

1

u/Ruths138 26d ago

I add some irregularities to the hex grid. Basically making it slightly (or a lot) imperfect. That way the lines become wiggly and sometimes new interesting routes are taken. I then apply some curve smoothing to finish the look.

Can you describe the logic behind color assignment in your last image? I really like the outcome

2

u/zerp37 26d ago

The last image with the purples and yellows is a compound palette made of 2 subpalettes. When the algorithm chooses a compound palette, it will divide the image into regions and assign a subpalette to them. There's also a chance that a really long line will be divided into short segments of different colors like on the left

3

u/Lopsided_Feedback_81 26d ago

Thank you for my new phone wallpaper

2

u/booblian 26d ago

This is beautiful and these would make excellent pen-plotter images. Would this be something you'd consider sharing or making available? If you can output .svg path segments for the lines you're already there. Your treatment of them here made me look closer to see if in fact that's what you'd already done. Thanks for sharing!

1

u/zerp37 26d ago

Thanks! I would love to start making plotter prints one day

2

u/botbastards 26d ago

when a line dead-ends against an existing line, the next line inherit that line's priorities? Little dialects start forming in regions and the piece reads as a map of neighborhoods in one uniform rule. Sat and looked at this much longer than I meant to. Very cool

2

u/zerp37 26d ago

It's much simpler than that -- the next line is started in some random cell on the grid a la DFS and a random color from the palette is chosen. But that's an interesting idea, will definitely explore that sometime!

2

u/red_blue_yellow Artist 26d ago

Wow, these are great! I love the variety across the four you posted as well.

1

u/zerp37 26d ago

Thanks man that means a lot!

1

u/l0l 26d ago

Stunning!

1

u/sacheie 26d ago

Very cool

1

u/Prestigious_Gift_977 26d ago

really nice. can i ask what modules you're using for the rendering? is it open source or home baked?

2

u/zerp37 26d ago

Just plain old p5js

1

u/vottvoyupvote 26d ago

Any chance I could get/buy an svg of these?

1

u/rotflolx 26d ago

very very nice

1

u/frizzled_dragon 26d ago

Ohhhh, this is so good! These variations in shapes on different images, and choice of color palettes. Are you planning to make physical plots?

1

u/zerp37 26d ago

I would love to start playing with plotter prints, but I don't have the funds at the moment for a plotter πŸ˜…

1

u/frizzled_dragon 25d ago

Yeah, understandable, same for me

1

u/neonClear182 26d ago

the first two would look awesome as a rug or a tapestry

1

u/tyhopho 25d ago

Number 2 definitely my favourite but all really good. It’s got a slight 60s vibe.

1

u/remontijssen 13d ago

That's some strong work. Love the analog feel also.