Help! ground pattern using offset and extrude from given surfaces

hello please help me asap i am coding a ground pattern and i really invested a lot of time but i cant find the problem
the code should offset and join the extrude the long 2 edges then do the same with the shorter ones with different random offset
i guess the problem is that the surfaces edges are in different order each time… so when i used cull pattern to remove the other 2 edges they are not the same 2 for each surface

pic 3 is the supposed way for the code to work but that what happen when i define alot of surfaces together
THANK YOU in advance
w14 ground pattern.3dm (1.9 MB) (18.7 KB)

can you internalize the surface ?

i tried but it didn’t work … i just edited the post and uploaded the rhino file … thank u for helping thogh (42.6 KB)
Try this
and just one thing, I didn’t use the first surface because it contains 5 edges not 4 as the rest so make sure you first clean the rhino model

Thank you so much u saved my day!!
and there is also another bug that the random component should be different for each surface, but nw it gives the same values for all of them? (45.8 KB)
graft its output.

thanks again it worked

1 Like

ohh when i tried another set of surfaces something whent wrong do u know why that happened

i guess the probem is that the surfaces has more than 4 vertex thus more than 4 edges can that problem be solved in gh (14.6 KB)
The problem is in the cull pattern you use for the edges, because the edges in different surfaces don’t have the same order, so instead of that, you select the two longest edges and the two shortest, that will maintain always selecting the edges you want regardless their order
Check the file

and yes this is another thing, you should clean the surfaces too