Grasshopper

algorithmic modeling for Rhino

Hi,

super basic question for a super basic GH user!!!

I have a square of points created with "series" and I would like to connect them diagonally (as you can see in the attached picture).

I need to obtain separately the series of lines connecting each point of the rows diagonally (i.e. the line connecting point n.1 of the first row in the bottom with point n.0 in the second row. The line connecting point n.2 of the first row with point n.1 in the second row, and so on)

thanks a lot,

Federico

Views: 3744

Attachments:

Replies to This Discussion

Here is one way but...

  • it required filtering out "long lines" that wrap (purple group)
  • the results, as seen using my 'Tree/List Viewer' tool (included) may not be quite what you expect since the short line segments "wrap" in a different way that might be difficult to use?

Attachments:

I forgot to include the 'Tree/List Viewer' tool - attached.

Attachments:

Hi.

Try to use "Relative Item". Best.

Attachments:

I tried that but didn't know how, thanks.

You could use one less 'Series' component:

Two great solutions!! Thanks a lot guys!

"Relative Item" is clearly the better approach and the one I tried first.  But it's been a long time since I wrote any path mapper code and while I got the relative path syntax using "{}", I had forgotten the list item syntax using "()".

Using Hyungsoo Kim's code, it's interesting to note the many variations that are possible and the effect they have on the results.

In the construct point ('Pt') component, either 'X' or 'Y' can be grafted; the results will change from columns to rows of diagonal lines.

Four variations of the 'RelItem O (Offset)' input result in diagonals going the opposite direction; or you can skip the list 'Item' component and connect the panel of offset paths directly to 'RelItem O' and get all four variations at the same time.

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service