I stomped upon a road block when trying to union the areas of various filled regions. Please see the attached image and .dyn file.
I have 3 separate groups of filled regions:
First group is blank with no filled regions
Second group has 2 filled regions
Third group has 1 filled region
I would like to perform the area union calculation within each groups, the result should have 3 total union areas, one for each group.
However, the issue arise when I tried to convert the groups of filled region into polylines and then solid union operation later on.
I believe this could be a list miss-match related problem. But I have no idea how to go forward from here. Any help would be greatly appreciated. Thank you
Thank you for the quick response.
At the moment the areas from the three groups are all added together. But I would like to perform the area union calculation within each group and the result should have 3 total union areas, one for each group.
How can I get the result to show:
group 1 union area = ?
group 2 union area = ?
group 3 union area = ?
@shkatti I suspected that might be the case, so I set up that rogue ‘List chop’ pathway in the example image also
If you run that through a patch/area function also, and then feed it through the following example (but instead of ‘list create’ just feed the output into the ‘list map’ input, it should sum each sub-list. I’d run it on the original example but I just started upgrading a massive model so all I have available is Dynamo 0.9 in 2016 until it’s finished!
The script needs restructuring. Collect your areas from filled regions as sublists - you should only run the list map/sum function right at the end of the script once you have the sublists (see above, where I have fed the lists in). All the list map does is say ‘sum each sub-list, then return them at that index as a total value’.
Hope that helps, send over the .dyn if you need more assistance.
So… had a look into it. I’ve tweaked the script to deal with empty, 1/2/3 filled region groups as a test.
I don’t think you need to use a union or solid/thicken process given the regions are 2D - hopefully I’ve understood your input requirements correctly.
I’ve ended up using level management in order to keep the list structure intact until right at the end, where I calculate the total area of each group.
Hope that works and helps! It was a fun little excercise
I tested out your graph. However I’m not getting a ‘union area between shapes’. Union area is an area without overlaps, a silhouette if you like, and not simply an addition of areas.
Oh… they can overlap - OK, the union method makes sense now. Just re-introduce the solid/union/top face method you had before after the surface by patch, and connect the output surface(s) up to the area measurement node - assuming you keep the levels intact it should hopefully still work and keep the sub-lists in order.
I’ll try to get it to work on my side also actually… it may need a special method to handle empty lists as they will become nulls.
OK… think I’ve found a solution. We can take the centroid of the solid unions and take an intersect on XY plane to get a closed outline. I tried the vector check method but it was problematic when it came to empty lists.
I’ve put a bit more time in as I believe this type of script actually has a lot of merit to my workflows also - lots of my users generate fills for test fits and high level space planning.Try this script