Grasshopper

algorithmic modeling for Rhino

Break single path into multiple paths at specific indices.

I have a list of items (under one branch) which I would like to split into separate branches at a list of specific indices.

 

Is my question clear?  Anyone know how to do this?

Views: 2747

Replies to This Discussion

There's a great new component in version 0.8.0064 which generates a list of consecutive domains from a single list of numbers. This used in conjunction with the SubList component gives you your desired split.

It's not the end of the world if you don't have the latest version because it's easy enough to generate the domains with Shift List

 Hi, Danny!

  I think this consecutive domains component is very powerful. Comment/Question:

Is there a direct way of generating the domains bounds  --taking your example-- like this:  0.0 To 1.0, 2.0 To 5.0,  6.0 To 8.0,  9. To 14.0,   15.0 to 23.0   .  There are many situations where you do not want to repeat an intermiadiate domain limit.

By using the Shift List method you can have an Expression on the B input of the Domain Component of B-1. Note that my original list must have the last number larger than the intended domain.

Thanks a lot for your expertise, Danny

Simple Enough!  Thank you!

May I ask a complementary question; better through a simple example ?

How to get List B from List A ?
List A                        List B
             {0}                         {0}
0.   {0;1}                  0.   1
1.   {0;3}                  1.   3
2.   {1;1}                              {1}
3.   {1;2}                  0.   1
4.   {1;4}                  1.   2
5.   {2;1}                  2.   4
6.   {2;2}                              {2}
                                0.   1
                                1.   2

Danny, brilliant, simple and mighty! Thank you again !

How would you change the domain bounds to cull the repeating domain limit if you generate the starting numbers with a series component?

I wouldn't use the consecutive domains for this. Use the Example above that shows the use of Shift Lists instead where the Expression in the B input is B-1. Note that this was posted when the default behaviour of the Wrap input was False.

Hi guys,

I'm having sort of similar question. How can you simply sort a list with different value into a specific range? Not partition into equal group but into range of 0.0 to 5.0, 5.1 to 10.0, etc. 

Thanks in advance. 

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