Hi, I have a set of surfaces in a certain data tree structure which I want to maintain throughout the end of the script. Each branch has a list of rectangles. The aim is to combine these rectangles into the biggest possible rectangles either through their X or Y dimensions(I’m open to any new suggestion as well). Check the images below.
In the above script you will find that I have used the cset component to find the unique dimensions and group them using the member index. Theoretically the member index is giving me the correct index numbers and branches, however when I try to fetch the items through the index, the indexes are getting mapped to incorrect tree branches, which should not be the case.
The end result is to find the largest possible rectangles out of these. I’m open to other ideas as well. I have seen the area division logics as discussed before in the other threads, I can’t really go for any kind of external plugin dependency or scripting component, even though any solution would work as of now.
Your fix also did the same but a bit longer. As for the purpose, I have a set of boundary curves. my goal is to divide them into largest rectangles and triangles that are possible. I was able to segment my irregularly angled curves into triangles and was left with the given boundary curves(image below).
So in order to do that I basically divide the surface into smaller segments using all of its edges. and then I was trying to group the rectangles formed by their dimensions. So rectangles of certain dimension ‘d’ will be grouped in the branch and then I can just join them together. But that logic has flaws as demonstrated below.
In the above image the simpler boundary curves are segmented easily. But the one having mixture of concave and convex edges has issues. The actual behavior should be as demonstrated below.
Yesterday, I was trying to approach this grouping logic from a different perspective suing anemone. But I have little to no experience with that. I’m attaching that attempt as well. In the meantime, I’ll read some more references for anemone as well.