Grasshopper

algorithmic modeling for Rhino

how to draw lines between each pair of points for a group of points

may I ask how to draw lines between each pair of points for a group of points?

Suppose I have 10 random points, the total number of lines between each point pair should be (10+1)*10/2 = 55

Thanks!

(correction: the number of lines between each pair of points for N number of points is: N*(N-1)/2)

Views: 5992

Replies to This Discussion

using the cross reference component seems to create duplication of lines: 324 points shall create 105,300 lines, but the result is different

I've just read through this whole discussion and either I'm missing something, or this is all being made a lot more complicated than it needs to be!

Just use  the cross reference component as above, but set to 'Lower triangular (strict)'. That's all you need.

The 'interconnect points' in Kangaroo was added before this option on cross reference was available - it is just doing the same thing and is redundant now. Also, the code inside it is essentially the same 2 lines as Tom posted below.

and here's an ancient post with some images of data matching options:

http://www.grasshopper3d.com/xn/detail/2985220:Comment:50861

Thank you, Daniel!

I revised the workflow as suggested (see GH file attached).

It seems the Kangaroo component is the fastest (< 10ms), considering the overall time used for all steps for each approach. I wonder what is causing the performance difference between Tom's script and the Kangaroo component if they use the same code.

Attachments:

Like this?

Attachments:

By Using Kangaroo's "Interconnectlines",  you can remove "0" length lines.

thank you very much, Hyungsoon, for your great suggestion!

thanks, Kim. but it seems some of the lines between point pairs are missing.

Appreciate if you can kindly advise!

Attachments:

also, the 3 points there should be only 3 lines between them:

hope you can kindly advise how to delete the duplicates.

Thanks!

Already mentioned, there are "0" length lines which you cannot see.

Thanks, Kim. I'm unable to find the interconnectlines component after installing Kagaroo.

Plus, what I mean is that there are lines missing as shown by the color lines below:

Or, you can use "Cross Reference" with "coincident"

And you should install Kangaroo V-0.099

Attachments:

Thanks! I'll search Kangaroo v0.099.

For the above workflow, there are still missing lines between points:

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service