Group.ByKey. or something


#1

Difficult to put in words but I want to group the initial elements list based on number of edges. Couldn’t find a key function directly and kinda want to work as shown. (But it won’t obviously.) Does anyone have a good idea?

21


#2

you can either put both of those nodes into a custom node, or use function.compose() where the first function curtain panel - passes it’s output to the second.


#3

thanks! But now I’ve tried both methods and both end up as a list with one element pr index as shown below. Am I missing something?

22

 


#4

Jostein, try doing the same function compose but run it through SortByKey. Then add a further step calling on firstly the boundaries and then the number of polycurves again into Group Items by Key List. I believe this is what you are after?

 

curtain panel

 


#5

all I get from the SortByKey node is null values?


#6

The CP.Boundaries has some weird behavior, where it adds each processed element to a sub-list. Therefore you need to apply a flatten command to the the function as well to counteract that:

2015-01-16_133143


#7

Well I don’t seem to get this at all… When I try what you say Dimitar, I get two list with all the elements repeated. Element at index [0][0][0] equals the element at index [1][0][0] and so on.


#8

Oops, sorry Jostein - I didn’t check the output and I was sure that would work.Oh well… when you are in doubt, you should python out!

Try and see if the following helps:

Capture