Merge with neigbour item

Hi everyone,

I have a problem.

  1. I create a surface and divide it in segments. (the shape varies per new created surface)
  2. I divide a surface with a perpendicular line in segments, I took it from the centerpoint.
  3. Check the area per surface, if to small merge with neighbour.
  4. Cull the doubles and the old ‘not’ merged ones.

My goal is to divide the surface on a preset distance, but if the areas become to small it needs to merge with the neighbour.

I am doing something wrong and got stuck in the code. It works good till the shift list is not working anymore, and when I wrap it on True the whole surface is merging.

Can someone help me please? GH Question.gh (30.3 KB)

Hi,

i thought at first this wouldnt be possible without looping/coding , but it seems it is.
Not 100% sure, test it!

MergeNeigbour_RE.gh (21.9 KB)

Thank you for the quick help!

I works good and I learn some new stuff!

There is one downside on the script, it merges in a condition with 4 areas where 2 are to small, to a fully merged area.
It would be nicer if it would only merge with the neighbors but this split is very difficult I think. (normal state: n+1, but in specific end n-1)

Fixed it, its ugly but it works :slight_smile: