Grasshopper

algorithmic modeling for Rhino

Intersection of multiple curves - sorting out points

Hey everybody!

I need help with lists! 

I have the following:

a list of 6 rectangles flattened

a tree of 30 lines sorted out in 6 branches (one per rectangle)

intersection of the two =84 points which are now in 72 branches

I need the points to be in sorted out per line, that is.. 30 branches 

what I actually need is to then cull the lines that have more than 2 intersections, maybe there is an easier way to do this? 

Thank you very much for your help!! 

Views: 2731

Attachments:

Replies to This Discussion

Hi.

Check this and next time, it would be better to clean up your mess to narrow down your problematic part of the definition.

Attachments:

Yeah, I agree with Hyungsoo Kim, that code is a huge mess!  I won't even bother to try and understand what all that code is doing that ends up basically generating nothing more than six co-planar rectangles?!?!!???  Some bits of data clean-up were:

  • Ignore zero-length lines (points connected to themselves).  When you connect six points to each other, there will be 30 lines total, not 36 - five lines from each point.
  • Ignore rectangles that aren't co-planar and can't possibly intersect.
  • Ignore duplicate lines (Hyungsoo skipped this one?).  When connecting all points to each other, every line is duplicated with end points swapped.  Visually, Hyungsoo's model shows ten lines but if you examine the data, there are twenty.  Each line is duplicated, which may or may not be what you want?

Finally, it might be nice to have the twenty intersection points for those ten lines?

Here's another version that removes duplicate lines ('DupLns' cluster) and gets the twenty intersection points for those ten lines:

Attachments:

You rock!! This is exactly what I wanted!

Thank you so much

Sorry about the messy file, for sure will have it in mind for future reference! 

Hi again,

I've been playing around with your definition because I also need to cull the curve that intersects the other ones (the long one).. I can't seem to find the solution because they only intersect with the rectangles.

I was able to find the points that intersect, is there a way to select the curve closer to a point? 

Thank you again!

Check this.

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