Grasshopper

algorithmic modeling for Rhino

Data%20Matching.ghHi all,

I have encountered such a generic problem for many times:

I try to apply some intersection between sets of lines and sets of rectangles.

After the intersection I would like to put the intersect pts (which on the same line) into the same path.

When I test it on 1 set of lines {0} with one set of rectangles {0} I can achieve it easily by graft on lines(see TEST 01)

However when I test it on 2 set of lines {0} & {1} with 2 set of rectangles {0} & {1}, it fails(see TEST 02).

(Lines on left is in path{0},rectangle on left is in path{0};lines on right is in path{1},rectangle on left is in path{1}. So lines on left will never intersect with rectangles on right)

If I apply a cross reference on it(TEST 03), seems it generates all the intersection pts however the path structure becomes messy(pts on the same line are not on the same path & there is some  repeated intersection even).

Has anybody happen to have the same issue before and know to achieve this?

Appreciate for any suggestion.

Thank you in advanced.

J

Views: 500

Attachments:

Replies to This Discussion

Hello

since you want the points according to the lines you will have to graft the lines output in merge component and flatten the output in merge with the rectangles and the line.

cheers

alex


edit*in that case cross reference can be skipped

Hi Alex,

Thanks for your reply.

But your way works well only when {0}objects and {1} objects are spacially separate...

If they are always spacially separate I can just use the TEST 01 definition to achieve it.

I think I didn't explain my goal clearly, my bad...

What I want is:

The lines in path{0} only intersect with rectangles on path{0}

and lines in path{1} only intersect with rectangles on path{1}.

Don't want all lines intersect with all rectangles(see image).

I wrote a component to handle exactly these situations, called "Propagate Ancestors". It's available in the "Tree Sloth" component set in the group Milkbox: http://www.grasshopper3d.com/group/milkbox/forum/topics/tree-sloth. It takes a data set of greater complexity (your grafted group of lines, for example) and then makes copies of a data set of less complexity to match it, but which has matching earlier paths (your rectangles here). Tree Sloth has a bunch of other useful bits for list and data tree management in it as well. I made the component group specifically to assist me when doing detailing, and list management gets particularly tricky.

Cool~

Great solution!!

Thanks very much nikos and David :D

J

Just have a scan through the tree-sloth library.

That is amazing!

I need to say again: Thank you for your great plug-in David!!

J

I'm glad if it can help you out! I'm also totally open to suggestions for additions to it.

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