Random reduce component - output culled items

If this hasn’t already been suggested - it might be nice if the random reduce list component had an additional output for the culled items… I know I can get this with set difference between the original and the reduced list, it just might be nice to have a direct output… Having it keep the list in the original order (minus the culled items) might also be nice… :smile:

Thx, --Mitch

1 Like

@DavidRutten Hi David, I just ran into this again, and was going to post a request when I realized I already had… Any possibility? If you’re randomly popping items off a list, it shouldn’t be too hard to collect the items in another list with a couple more lines of code… or?

Edit: OK, now I’m stumped… Sets can’t work with geometry data types like Breps… So If I have a set of Breps and a reduced set using the Random reduce component, how do I get the culled items?

What I have is :
Create a series of consecutive integers same length as list of original objects
Random reduce the integer list and sort
Use the random reduced list of integers with List Item on the list of objects to get the reduced set
Use set difference between the full and reduced integer list to get the culled indices
Use List Item with the above set of indices to get the culled objects.
Seems rather a long workaround…

Thanks, --Mitch

Hi Mitch,

Use the “Item index” component. It can check if two items (numbers, any type of geometry…) are placed in the same location in memory:

But I agree with you. Maybe not culled items, but “culled items indices” output for “Random reduce” component, would certainly be nice.

itemIndex.gh (13.6 KB)
itemIndex.3dm (271.6 KB)

Yeah it makes more sense to have a random split component instead. A lot of the components in list and set panels are half-baked or redundant or overlapping and in need of a rethink. I was going to postpone that until GH2 though, but if this is a major annoyance now I can fux it for the next release.

Yes, that would be best, for sure…

No, no major annoyance, just thought it might be a quick fix item… I’m sure there is more important stuff to get done now.

Thanks, --Mitch

Ah, interesting workaround djordje. Didn’t know you could plug anything other than integers into the index input… Learn something every day…

Thanks, --Mitch

The “Item index” second input “i” is an abbreviation for “item” actually.

Actually, now I get it… Somehow read “List index” when you said “Item index”, so of course what you showed makes perfect sense now…

Cheers, --Mitch

This discussion is a bit old, but thought I’d throw another way to do it (if I understand you correctly).
I keep your consecutive index list, jitter that, and split the list of indices according to how many you want to reduce. Jitter takes care of the random aspect.