algorithmic modeling for Rhino
There's two approaches that make sense to me:
I'd start with approach #2. First you calculate the areas of all buildings. This also gives you the area centroid. You figure out which plot region contains each centroid and use that relationship to modify the plot areas.
I may have time later today to make a small example, or maybe not, depends on whether my cat shows up out of its own volition or whether I have to go search for it outside.
Here's a fast(er) solution:
Assuming: Plots don't overlap, and each building resides in one plot only:
1a. Take the polygon center (fastest, take area if you need to because there are curves) of each building. (Works for concave shapes).
1b. Compare the distance of each block center to the distance of all building centers. Might stop working if any of the shapes used are concave (not convex).
2. Use the Point in curves to deterimine which curve resides in which plot
3. Use the index output to set the path of each curve to the path of it's matched plot.
4. Add back empty paths for the plots to the list that do not have a building. (So the paths of the buildings and the paths of the plots are the same. (Keep in mind that clusters can't handle empty paths, so you should replace empty paths with a bogus value).
5. If you now add the building to the grouped plot path you can easily do a planar surface.
I've added two solutions, I generally use two or three components in C# for this (Many-to-Many matching/grouping):
1. To manually set a path. (Set path: sets one path for each branch in a tree)
2. To ensure path equality. (Make sure that for every path that exists in tree A will also exist in tree B, the result may contain empty branches)
3. To replace null branches (Similar to replace null, except you replace empty branches)
Hi both,
Thanks for the solutions, i just need to try and understand how they work now! Pretty new to Grasshopper so i'm not familiar with all the plugs.
Most appreciated, thanks!
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by