Grasshopper

algorithmic modeling for Rhino

Hi everyone,

 

I have multiple intersecting surfaces and I am trying to create a SINGLE curve at each corner. The problem I’m having is that each surface intersects with 2 others, so when I use the Brep/Brep component I get 2 curves for each corner. I’ve used the Remove Duplicate Lines component from Firefly in the past but that method creates problems downstream in some cases. I would like to generate the intersections cleanly, without having to remove duplicates with the Remove Duplicate Lines component.

 

The original list of surfaces comes from a larger definition. Therefore the surfaces may not always be listed in succession (i.e. they may not always be listed in a predictable order). The total number of surfaces will vary from case to case (but there is always a minimum of 3).

 

I’m guessing I need to associate each surface with only one of its two adjoining surfaces for the intersection, but how exactly is that done? I’ve tried using the UV parameters of the surfaces to sort and choose based on distance but this doesn’t work reliably (at least in the way I’ve done it).

 

Any ideas on how this can be done?

 

Thanks,

 

cbass

 

Views: 2276

Attachments:

Replies to This Discussion


Hi cbass, 2 more solutions:
Attachments:

Notice that Pieter's solutions are faster.

Though if you sometimes get surfaces like these:



, you will have to use mine.

 

Also, the perimeter sort used wont work if the center points are not on a convex curve, like this:


(you probably dont have surfaces like this, but I like to be annoying)

Excellent examples guys and definitely simpler than what I was leaning towards

 

I particularly like Pieter's second version, as it answers some general questions I've had about sorting in a clockwise or counter clockwise direction.

 

Thank you both for your help!

 

cbass

I don't think it can get simpler than this. 

 

Chris

A bit more on sorting then, for your pleasure (convex shapes too;)
Attachments:

Ahh nicely done, I was thinking about something similar (intersection with a plane to get outline curve), but I got stuck on joining the intersections into one curve.

Now of course its a lot slower, but its an interesting  proof of concept.

By the way, what if you cant find a plane intersecting correctly all the surfaces ? (evil grin).

 

Single intersections (well, removing dups), no sorting though. It might be just what remove duplicate lines component does.
Attachments:

Chris: If I'm not mistaken, the example you gave was exactly what I had in the OP, the difference being that I used the flatten, clean and graft components explicitly through their components. I had already used the Remove Duplicates component and was looking for a way to avoid its use by handling the data in a way where duplicates would not be produced. No worries as there are several solutions in this thread which do what I was looking for.

 

Pieter: Thank you for the alterative solution. I changed it a bit as the Plane Surface you used is confined to the XY and in most cases, my geometry won't be on the XY (I forgot to mention that in the OP). Also, I carefully studied your solution for flipping flipped curves. Again, this works assuming that everything is oriented in the XY plane. Very nifty parsing of the Z coordinates, and I'm sure it will come in handy in the future. I already have what looks like a reliable way to flip curves for proper lofting, but thank you all the same!

 

Systemiq: "What if you cant find a plane intersecting correctly all the surfaces ? (evil grin)." Good point. Luckily for me, these are always intersectable by one plane but your comment reminds me to try to be as thorough as possible when describing the situation, given the amount of time people put in their responses.

 

Thanks again everyone!

 

cbass

Systemiq et all,

 

As I progressed in my project, I did find situations like the one you showed above where the surfaces where arrange in a concave fashion.

 

I ended up intersecting the surfaces with their own top edges, and using the resulting curve with the Curve CP component as Pieter had done. Also note that the top edges of the surfaces are always co-planar, though the bottom edges often aren't (i.e. some surfaces extend further down than others). I used the top edges of the surfaces for this reason. Index 2 in my List Item component seems to select the correct edges, although as I get more familiar with GH, I know better than to assume it always will!

 

cbass

 

 

 

 

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service