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

Thank you very much, Hyungsoo!

Now it works.

Thank you very much, Tom!

I shall try the same using Python.

Hi Tom, here's the Python application of the approach you suggested.

I'm still in the process of learning on how the GhPython component deals with different types of inputs (item/list, type hint, etc) and how it calls rhinoscript or Rhino functions ... quite confusing at this stage. Hope you and Kim can kindly advise if you have GhPython programming experiences.

Thanks!

Attachments:

Thanks, Tom!

I need to read a bit more on Rhinoscript and RhinoCommon. But if I may, what is the difference between them when using Python to access?

(I'm replying Tom's latest reply, since there is no "reply" button on his post for me to reply anymore... )

Thank you very much, Tom, for your explanation!

Is "data type" and "variable type" the same thing in Rhino? My understanding is that "data type" is about the type of object (pt3d, vector, line, brep,...), and "variable type" is about type of variable (string, float, int, list, ...)

Python doesn't need to declare variable type. So we have to use the Print function to check the type of object, or data type, store in a given variable, is it?

it seems that using the Tom's Python script or the Kangaroo's interconnectlines component are the fastest ways to create lines between point pairs without duplication:

Attachments:

out of reply space.

David since they are bundled inside gh tabs, which i prefer, against too many plugin tabs, i was wondering if there is a benefit of having in front of Tree sloth components an identifier, like TS or similar. Just like in Rhino command where for example for weaverbird we type wb to get access to the commands.  I keep finding myself suggesting your components as gh native.

best

alex

I find strange bug in Rhino6 - interconect (Kangaroo2) doesnt work ((((. 

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service