Quadtree or recursion with image sampler

Hello,

I am still new to grasshopper and I’m trying to figure out how to replicate this image effect? I assume it would require some sort of recursion or quadtree in an image sampler. Also, maybe after creating the quadtree I assume they might be using a pick and choose or a similar tool that allows to scale a module into each quadtree square?
I have seen similar discussions but none that includes an explanation or sample script of how to do this?

This might be of some help to you.

Thanks HS_Kim for sharing! I’ll take a look at it

Hi HS_Kim! thanks for the script it’s very interesting.

If I may ask since you already end up with individual squares, is there a way to have a sort of PickNChoose system where one could contrast the shade of the square in the image sampler and asign a certain pretdetermined shape, like letters or shapes like a star, square, circle, according to the value from 0 to 1 in the image sampler. The tricky part is I know PickNChoose doesnt scale shapes, as far as I know. I made a quick example by hand

this could be a way:

File:
Frit Pattern_re.gh (306.0 KB)

Try improve this

Using dice faces

@seghierkhaled, @HS_Kim & @Baris thanks you so much for the replies guys! I’ll take a closer look at it and try to wrap my head around this methods

Ps: Before the tutorials I had seen about quadtrees involved recursion using Anemone, so I’m still wrapping my head around the theory of how to achieve this only with domains, sets and lists.

Hi @Baris, awesome solution! There’s one thing I can’t wrap my head around, maybe you can explain. How does the algorithm choose which shape will go on each square? Is there a logic or is it just random?

@HS_Kim, @Baris & @seghierkhaled I might be taking this whole thing in a tangent but I was wondering if it is possible to apply the quadtree logic to a double curvature surface based on the angle variation, I did something by hand sort of trying to show what I mean, where the more angle difference the more lines. Haven’t seen something like this thus far.

surface for quadtree mesh.3dm (2.5 MB)

you need to match the lists.
The first brep you reference will be the index 0 (first item in list) and so on.

Well, that’s a completly different animal.
I made some script a while ago, it could get you started.

20200815_SubDMeshSrf.gh (48.5 KB)

@Baris that’s brilliant! I definitely need to learn C scripting, thanks for the support!

You sure could do the same with annemone or hoopsnake or something.
It’s not that complex.