Grasshopper

algorithmic modeling for Rhino

Hello grasshopper heads,

I'm trying to sort a hex list in order to be manipulated later on a 3D surface but still get a vertex list with duplicated points at the same positions after trying to cull all the points. Any thoughts? ...Images attached. 

Views: 1085

Attachments:

Replies to This Discussion

You mean that you want to sort the hex vertices (BTW: what means sort? maybe OrderBy X/Y/Z ?) and get a List of unique pts?

Hi Peter,

Well, the introduction was kinda redundant indeed. Thanks for the attention though. I'm trying to see if it is possible to order the points of a, let's say, hex grid in different orientations. Like the images attached. I have been testing the sorting along curve component and it does a good job on the overall flattened order. However, i'm trying to have more control over the data matching between two surfaces and connect them with lines in a different fashion. By doing so, i would have a nice volumetric connected structure. 

Any thoughts are appreciated.

Well the good news are this is rather very easy via code (especially if code is used to do the hexagons "directly" working with some surface division pts Tree - bypassing stuff the likes of Lunchbox). Using HashSets for sampling the unique points etc etc.

PS: I guess that you want a variety of hex combos (touching [on node or edge] and/or various neighbor combos as well).

On the other hand (native components): a "classic" way to work on neighbor combos is to get a convex hull collection out of the nodes > a curve >  then sort the points along that curve. Shifting (wrap on) the List indices yields an index 0 ... er ... where you wanted to be.

BTW: In case that the above sound Greek to you (expected: I'm Greek you know, he he) ... here's a stupid demo (among a zillion others available) that I use to train my people in the practice ...er ... on order/sort/whatever matters.

The real thing is far more complex (and has NO GH native components) but I do hope that the attached can (?) guide (?) you into the unknown with regard sorting matters.

Attachments:

Added some options more that are rather closer to your goal(s)

Attachments:

Greek Peter, you nailed it. The work on the coding is sharp, not easy but clever. Aristoteles would chuckle seeing this. Thanks for sharing!

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