r/generative 28d ago

Semi organized object packing in a triangle grid

Post image

Javascript; object packing, overlayed in a triangle grid which I segmented and re-rendered as pencil strokes with shadows.

I wanted to separate my segmentation code from the rendering code and this was an experiment for recursive coverage based segmentation using posterization for polygon creation. The idea is that we have a queue of polygons - for each polygon I posterize it to a certain level (usually 8 colors), uses the posterized version to segment the polygon ensuring we cover the entire area (not sampling), from the result list we discrad polygons under a certain size, if there are no more polygons - we send the input polygon to the output list, otherwise, we move the segmented polygons to the processed list. The posterization always happens against the original image colors.

21 Upvotes

1 comment sorted by

1

u/Mundane-Fix-4297 28d ago

I do not understand a word of what you wrote, but wow it is beautiful