Grasshopper

algorithmic modeling for Rhino

Hey all,

I'm working on a definition to generate a point cloud and connect specific chosen points from it. 

Ideally I have a number list alongside the points so I can label points I want to connect with the same number - in the attached screenshot as an example I would want points with index 0 and 1 to connect, and points with index 2 and 4 to connect.

How would I set up a picker that can identify the indices of points labeled with the same identifier in the number list?

Thanks!

Views: 3510

Attachments:

Replies to This Discussion

I think what you want to do is sort the list of indices with the list of points synchronously. Here's one way to do that:

The Cull component is needed because it is connecting 0 to 1, 1 to 2, 2 to 3, etc, and you only want every other line.

Thanks for the help. This method will only work for pairs, though, correct? Ideally I'd like a method which could connect any number of points with the same assigned "index." 

then maybe member index and list item could solve this for more than two points.

member index finding the index in a list for a specific value and list item for listing the indexes from the points list.

I think that's what I'm looking for - thanks!

This ended up working great!

Attachments:

Great!

good luck with your project.

So you want to connect points according to the numbers list. Does it have to be so that these numbers are met in the x values only or both x and z? 0 and 1 and 2 and 4 have the number in both x and z.

if that the case cull the values with equality component for both x and z and use gate and component. that way you will have all the points having x and z with the value from the list tested each time.

cheers

alex

edit* sorry had not seen damon already had answered

Thanks of the comment -
I'm not trying to sort them by any inherent property of the points - I included the panel with the point XYZ values just to illustrate the point list, rather than information that needed sorting.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service