generative modeling for Rhino
I am relatively new to Grasshopper and suffering the stumbling block of trying to tease out the data I want from the flow.
I want to find the emergent shapes that are a result of a grid of overlapping polygons.
I am thinking I want to use the Region Intersection box but having trouble feeding in the correct items to get out what I want. I thought I should take the list of polygons and for each one find any intersections with all the other polygons but having trouble extracting each one to the compare to the rest. Tried doing a cull approach but it is not working. Also I want to avoid duplicates of the resulting shapes which I think is also going to be a problem.
Any advice greatly appreciated, have attached a screenshot of what I have so far....
I gave the problem a quick attempt - I think I've gotten a bit further than you but I'm getting stuck with my tree structures. For some reason, it isn't closing all the intersection curves for me. If this is for a small project, you might be able to decompose the curve and remake them closed.
Thanks! I think this is definately getting closer. But It seems really odd that some of the shapes are missing one part, I can't see why this would be?
Getting these emergent shapes is quite fundemental to my long term project so I am hoping to find a reasonably elegant solution......
I went through the code bit by bit and it seems that it is working in theory but I think there are problems where the z value is not exactly exactly zero - I'm not certain why this happens sometimes.
I've managed a type of workaround - the result needs to be tested a bit more strictly though and there are performance issues associated:
- Instead of working a intersection between the polygons as curves, consider an intersection between a closed polygon extruded perp and the rest of the polygons made into surfaces. The result will be some of the curves needed and the other curves will be made in later iterations. Clean and join for the end result.
The vector could be more simply defined than in my script below but I think it's better this way in case the surface is rotated at some later date.
Wow thanks for doing that, not sure I completely follow it, seems a very complicated way to do it everytime.
I have still been trying to finad a solution with the region intersect as I felt it might be easier if I could get it to work. I have tried to connect it in various ways as you can see in the screen shot below. Two give me what I want along with lots of other duplicates and the original curves and I can't work out how to seperate out what I want. The one I thought would work if I got the culling right doesn't give an error but just does not seem to output curves although the output number look right?
I also want the region differences and have managed to get that working nicely with the culling that you helped me with.
Is this the effect you are looking for?
1) Create a set of data where every polygon has a turn at being first in line.
2) Separate these sets so that the "interested" polygon is removed from the "others"
3) Find all "other" polygons that intersect with the "interested" one.
4) Use Region Difference to create the desired shape from our "interested" polygon and the intersecting "others"
its item 3) where it gets a bit tricky.
Just saw your post after I posted the last one.
Thanks for looking - the layout is really helpful to see some new things.
I do want those shapes as well, I think I managed to do that with the region difference. But the ones I am having trouble getting are the overlapping squares rather than whats left....
Looks like I could make those shapes in the same way as you did, by joining up the points from the CCX in a different way, will give that a try.
Thanks Danny, with your solution helping I just managed to find the overlapping shapes aswell, I think I actually just had the inputs round the wrong way round for the intersection!
Going to look more closely at the way you use and select the surrounding polygons as this is probably better than just using them all...
Again thanks so much for everyone's help!