# Problem to divide surface in to 2 sets of squares

Hello everyone, I am new to scripting and trying to achieve a random pattern into a surface using two sets of squares, one of 10x10cm and the other with 20x20 cm… I did this script but could only achieve the green geometry in the image, I tried to define the surface corner with the vertice, but i don’t know exactly how to do that

mosaico 10x20.py (1.7 KB)

anyone??

this is a very basic sketch with Anemone looping:

every point that in the grid that did not generate a 20x20 tile can generate a 10x10 tile

small tweaks here and there, like giving the tiles range “1 to 19” instead of “0 to 20” in such a way they won’t be recognised by Collision One/Many if their edges are touching…

BruteForce_Random_tiles.gh (17.8 KB)

1 Like

Ohhh nice! I wasn’t being able to script in gh because haven’t found the means so I was trying to work around python, but this anemone i never used, seems nice! thanks for the help man!

I wonder how could I get those not used points to generate the 0.1 tile, I think I need to get the rest of the numbers that didn’t get gated, but don’t know how to do it.

one way might be to just use again collision many/many:

BruteForce_Random_tiles_Re.gh (18.0 KB)

2 Likes

superb, way simpler than what i thought, nice!

See other solutions here :

1 Like

i don’t know why, it already achieved the final result I was planning, but I was planning to do this with random reduce in the 10x10 tile. Why some of the 10x10 tile are not appearing after the colision?

post your file please and I’ll have a look

BruteForce_Random_tiles_toinno.gh (21.0 KB)

nice!

starting surface not internalized .___.

are you using it on XY plane?

It is in xy plan but I transformed it a little bit so the grid could properly fit in the surface that correspond to the area of the tiles

tried to plug a random surface on XZ but can’t really say what’s going on
for sure if you want to generate tiles on XZ you should plug a XZ plane and extrude toward Y instead of Z

for more investigation, please upload your GH file with internalized starting geometries (right click on the Surface component and chose “internalize”)

sorry! here it is, with internalised data
BruteForce_Random_tiles_toinno.gh (30.4 KB)

start domain of the big tiles is set to 0
this means that Collision One/Many will prevent any type of tile to be created, if by doing so it will go through that point

setting it to 0.01 solves that problem (same as for upper boundary set to 0.199 instead of 0.2 )