Page 1 of 1

Filter Split in Half

Posted: Wed Apr 10, 2019 4:44 pm
by jumax
Hi all

This should be real simple but its doing my head in, I have some particles going down a spline and when they reach a certain point it needs to go down another path. I have setup another spline for this and what I want to do is use a bounded filter to send half the particles to another to domain2 where it has a new dpline to move it along. I have tried setting it to filter by speed or random position but I always get an uneven distribution it dosent have to perfect but would be great to get close.

Cheers

Re: Filter Split in Half

Posted: Wed Apr 10, 2019 5:24 pm
by jumax
If we could split by even or odd Ids that would be helpful but I am zero at scripting :|

Re: Filter Split in Half

Posted: Thu Apr 11, 2019 3:26 pm
by jumax
after some digging on the forum got this far


(particle.id>20000 & particle.id<30000)

It works but still not elegant would be great to get random values in this range

Re: Filter Split in Half

Posted: Fri Apr 12, 2019 3:27 pm
by Forester
When I have this kind of problem, I create two filter deamons. One for moving the original particles to the second domain, and one for moving the particles in the second domain back to the first domain. I focus on the "Random" setting in each filter, and adjust the Random values in each filter until I get a good balance of particles between the two domains. Since Realflow is calculating both particle transfers at each step, the net "look" at each step can be that exactly half of the particles are flowing into each domain.

This kind of technique is what you would use when pouring champagne into a glass, for example. You want some of the champagne to turn to foam, but other of the champagne to remain as the liquid. Or you want the foam to quickly turn to champagne again. So, you adjust the two Random setting values until you get just the look you want.

But, this technique will work equally well for your two spline situation.

Is this understandable? If not, I can explain further.

Re: Filter Split in Half

Posted: Mon Apr 15, 2019 9:09 am
by jumax
Hi

Yes I understand, with the expression that i am using playing the values I get a decent result as well but I am still interested in figuring out the expressions as I think it would be useful in the future. Also when i change the forces I have to redo the values which is not fun.

Re: Filter Split in Half

Posted: Mon Apr 15, 2019 9:08 pm
by Forester
Good! I'm glad this is working for you.

If you have an expression you find works well for this purpose, please consider posting it here. Kind of a "thank you" for the help people attempt to provide.

The reason I like the double Filter mechanism, is that it is particularly easy to make adjustments to the Randomness value when other settings have to be adjusted. (Per your second comment above.) It's really the ease of operation that I like. But, of course, this is a "kludge." It is not a direct solution to a problem like yours. Direct solutions, such as via an expression always are preferable, so good for you!

Re: Filter Split in Half

Posted: Tue Apr 16, 2019 9:26 am
by jumax
Hi Its the same one i mentioned above. Just tweaking the Id values to get a decent result for example these values below were giving me a decent result
(particle.id>20000 & particle.id<600000)


someone sent me this expression but its not right maybe someone can tweak that
particle.id %2=0

Re: Filter Split in Half

Posted: Tue Apr 23, 2019 3:01 pm
by Forester
Thank you! (For the expression post). :|