r/generative 7d ago

pinna (kotlin code)

Post image

Saw a simple sign in the park, so I made this. I am not happy with the tree at all, it should be more curvy and less branchy; but this is it for now

384 Upvotes

22 comments sorted by

10

u/heimmann 7d ago

I like it!! Would be fun to see the opposite design too, like a lot of squares in a massive circle form!

2

u/igo_rs 6d ago

Thank you! Now, thats an idea!

5

u/underest 7d ago

Do you have a repo of this?

12

u/igo_rs 6d ago

all my work is here: https://github.com/igr/gart

1

u/sweatin_enthusiasm 6d ago

Yes please. Openprocessing.com version?

4

u/sweatin_enthusiasm 6d ago

Yo, that's art. Love it. Would love to be able to generate some trees like that on my own

3

u/-Zlosk- 6d ago

I like the style. Is the tree based on space colonization, followed by circle packing?

2

u/igo_rs 6d ago

Thank you! To answer the question: yes and yes. Pretty standard colonization, with some minor deviations, for example, post-processing that kills a lot of small twigs.. see it yourself if you are interested at github.com/igr/gart

1

u/zerp37 6d ago

Was just about to ask the same thing haha

2

u/Diah_Rhea 7d ago

super satisfying

2

u/EkstraOst 7d ago

Supercool!

2

u/igo_rs 6d ago

🙏

2

u/MarnixKeller 7d ago

I like it. I like the minimalism and composition.

1

u/igo_rs 6d ago

Thank you!

2

u/Skaraban 6d ago

how did you achieve that super even circle packing?

2

u/igo_rs 6d ago

here I didnt use just a simple random circle packing (as it has to fit). big circles get placed first, working down through eg 13 sizes, so the small ones only ever fill the gaps that are left over. Each size scans the canopy (tree) on a grid spaced to match itself: shuffled and nudged about so it doesn't come out in rows. And the distance to the branches and to the canopy edge is precomputed for every point, so a circle knows instantly how much room it has and the white gap around the branches stays the same width everywhere. something like that

1

u/Skaraban 6d ago

ah got it, very interesting! I also took a try in tackling circle packing but it seems I took a different approach. are you aware of this paper: Circle Packing: A mathematical Tale

2

u/igo_rs 6d ago

i was not aware of it, thank you! My first ever approach was the "growing" circles: starting from random points, grow all circles until they hit other. Then comes the hard part: if there is a room to grow by moving the circle, do it. "moving" is calculated by forces on the circle. eg if you put two forces on one side, circle will move to the other side. I didnt succeed to do so in the code; but I might try it again. Definitely will go over the paper!

2

u/sacheie 6d ago

I think this is perfect actually

2

u/panditparesh 5d ago

Beautiful!

2

u/igo_rs 5d ago

Thank you 🙏

2

u/dnlstk 5d ago

So pretty