Grasshopper

algorithmic modeling for Rhino

hello -

i have a bundle of lines and behind them some objects. now i want to have the points at every intersection of a line and an object outline.

with all the intersection comands (curve/curve, curve/line, line/line) i always just get intersection points of some lines and some (parts) of objects.

what is wrong?

thank you!

Views: 666

Replies to This Discussion

This will be easier to answer if you post a screenshot or file of your problem.

sorry -

here...

Attachments:

Graft your input curves. (use a graft component or right click the C input on CLX component and choose graft).

thanks a lot!

why is this necessary?

You would get the same result by right clicking CLX and set the Cross reference option.

By default, all components are set to Longest List if they accept multiple parameters.

If we take CLX as example, if you have 10 curves and 100 lines as parameters, the component will find the intersections:

(Curve1xLine1, Curve2xLine2, .... Curve 10xLine10, Curve10xLine11, ..., Curve10xLine100).

If you set CLX to shortest list, it will be (Curve1xLine1, ...,  Curve10xLine10).

And with cross reference, all the possible intersections.

 

If you graft the curves, CLX will treat each curve as a different object. So it will return:

(Curve1xLine1, ...,Curve1xLine100)+...+(Curve10xLine1,..., Curve10xLine100)

It's to do with the way Grasshopper handles data. Imagine creating lines between two sets of points. The first set contains 5 points {A, B, C, D, E} and the second set also contains 5 points {K, L, M, N, O}. In this case it's very obvious what needs to happen. You want to create lines combining the following points {AK, BL, CM, DN, EO}.

 

If the second set however only contains 3 points {K, L, M}, it is no longer obvious. The default behaviour for Components is to keep on matching points until both sets are depleted. This is called Longest List Matching. It will give you 5 lines, that connect the following points: {AK, BL, CM, DM, EM}. As you can see, the last point in the second list (M) has been 'recycled' three times.

 

You can also change the default data matching behaviour. For example if you change it to Shortest List, then the component will stop working as soon as the smallest set is depleted: {AK, BL, CM}. In this case the points D and E are completely ignored because no 'sibling' could be found for them in the second set.

 

A third option is Cross Reference matching, which will create all possible combinations: {AK, AL, AM, BK, BL, BM, CK, CL, CM, DK, DL, DM, EK, EL, EM}.

 

However the best solution in this particular case is not to muck about with the data matching, but instead Graft your data. Grafting means that all the items in a set are moved into their own little set. Thus, if you graft {A, B, C, D, E}, you actually end up with 5 sets, each containing a single item {A}, {B}, {C}, {D} & {E}. When you combine this new data layout with your second set {K, L, M}, each grafted item will be matched with all the items in the second set, this is after all how Longest List works. So you end up with a data layout that looks like this: {AK, AL, AM}, {BK, BL, BM}, {CK, CL, CM}, {DK, DL, DM} & {EK, EL, EM}, which is very similar to the Cross Reference matching, but retains more of the original layout. I.e., it's not just a huge list of all the lines, they are still five groups of three items each, which is a far more informative layout than Cross Reference would generate.

 

I'm afraid at this time of night this is the best I can explain it. 

 

--

David Rutten

david@mcneel.com

Poprad, Slovakia

oh this is so caring of you both.

thanks a lot!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service