Grasshopper

algorithmic modeling for Rhino

Hi to all of you Grasshopper experts.

I tried to find something related in the Forum but somehow no sucess so far.

How to split a list into multiple (at least three) sublists by a 'big' change of data value.

In this case it will be between position 86 and 87 where the x value of a point jumps from 2.32... to -6.04... (see inside red rectangle @ attached image).

Idea so far is:

1) Decompose the list into x,y,z

2) get just the x values in one list

3) compare all values in a kind loop.

4) if value difference is more that let's say 1.0 - get the index

5) split list at that index.

 

My question: How to do that without looping?

I would be very thankful is someone could give me a hint.

Best, Boris.

Views: 1817

Attachments:

Replies to This Discussion

Hi Boris,

Firstly I would check to see if there is a point in the code where you have flattened the data thus making these numbers become a single list and work out how to keep them in there tree structure going forward from this point.

If this is not possible, then try this. 

Hope that Helps

Matt

Attachments:

Hi Boris, if you don't mind using a VB component (which does use a loop) you might like this:

Attachments:

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