Grasshopper

algorithmic modeling for Rhino

Hi  
 
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.... 

 

 

Views: 2567

Attachments:

Replies to This Discussion

Hi Lynne,

 

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.

 

Hi Zygnoth,

 

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.

 

Hi Zygnoth,

 

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?

 

Where the Red cross is the Region Difference of that polygon and the surrounding ones. If so then In pure data tree management this would be the way:

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.

 

Attachments:
Of course! Find the shapes that intersect with the shape you want...very nice move Danny.

Actually what I've done is data tree management for the sake of data tree management.

You don't need item 3) at all because if the "others" don't intersect they don't have any influence on the shape.

Although slightly more time to compute this approach works just as well.

Attachments:

Hi Danny,

 

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!

Are you more interested in the little squares?

In which case Region Intersect is the Component you require. From past experience its better to put the "others" into input A and the "interested" one in Input B as sometimes you don't get any results the other way around. 

 

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!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service