combi, on 25 February 2012 - 06:44 AM, said:
I was just wondering if just setting the group sop operation mode on "Group By Range", and setting select 1 of 5 to get exactly 20% (or 1 of 2 for 50%) was also an option?
I just came to it because when looking at the content of the groupTransfert sop, I was not sure the results weere good for the exactly_50 one...
Yeap, that would work. Although it would be a bit less flexible, e.g. if you wanted to have 0..1 slider to control how large a portion you wish to select.
If rand() is properly random, it should not matter whether you take the first 20% or every fifth. The bad part of being properly random is that there is nothing preventing getting numbers that are close to each other - resulting in clumping in the result. If anyone has good ideas on how to prevent it in a situation like this, I'd like to hear
Some thinking out aloud:
There is the nrandom() / NonDeterministic Random vex/vop function that can be used to get a mersenne twister or quasistratified random sequence, but I'm not sure how to get that in a useful way to an (especially) primitive selection.
Using it in an nrandom() < 0.2 fashion loses its special qualities (I think), one should first run some vex to get a sequence that could then be used as primitive IDs to select.
Another idea might be to scatter points onto the geometry and then somehow select the polygons the points end up in. (schnelli's uniform scatterer
Or, if you want 20% of the faces, you could break up the geometry into 20 chunks with a ForEach SOP and select 1 face from each chunk - a kind of bruteforce startified sampling.