Best way to kill lone particles in FLIP sim?

   Views 2024   Replies 4   Subscribers 1
User Avatar
Member
1 posts
Joined: 5月 2021
Offline
Hi guys,

fairly new to Houdini.

I am running a small-scale flip sim and am just wondering what the best way to delete particles that go off on their own is before I surface mesh it.

Is there an expression that would delete particles in small groups or with few adjacent particles?

Or an appropriate attribute I could fit a colour ramp to?

Any help would be greatly appreciated,

Thankyou
Edited by purps - 2023年10月31日 19:17:49

Attachments:
flip_sim.PNG (4.5 MB)

User Avatar
Member
761 posts
Joined: 2月 2017
Offline
Hey purps,

you can utilize the pcopen and pcnumfound vex functions.
Use this in a point wrangle it will create an attribute for you called density.
you can blast points after that based on a density threshold.
float radius = chf("Radius");
int number = chi("Number");
int pcloud = pcopen(0,"P",@P, radius, number);
int amount = pcnumfound(pcloud);
f@density = fit(amount,0,number,0,1);
@density= chramp("Ramp",@density);

Cheers
CYTE
Edited by CYTE - 2023年11月1日 08:17:43
User Avatar
Member
9083 posts
Joined: 7月 2007
Offline
you can potentially also play with FLIP Solver/Particle Motion/Droplets/Detect Droplets
you can either kill them directly within threshold
or can also help with those isolated particles not influencing the velocity field and then after sim you will have droplet float attribute you could possibly use to remove those
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
4828 posts
Joined: 2月 2012
Offline
Hi,

You can use VEX to do this iteratively inside a for loop network like this:
int input = chi("ninput");
float radius = detail ( 0, "pcl_radius" );
int maxpts = detail ( 0, "pcl_maxpts" );

int @nearpt = -1;
float @neardist = -1;

if ( input == 0 )
    ++maxpts;
    
int pts [ ] = pcfind_radius ( input, "P", chs("radius"), ch("rscale"), @P, radius, maxpts );
int count = len ( pts );
if ( ( count < maxpts ) == !chi("invert") && @ptnum != min ( pts ) )
    removepoint ( 0, @ptnum );

You can alter the radius and max point number progressively for finer tuning of deletion.

Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com] https://lnk.bio/animatrix [lnk.bio]
User Avatar
Member
1 posts
Joined: 4月 2017
Online
tamte
you can potentially also play with FLIP Solver/Particle Motion/Droplets/Detect Droplets
you can either kill them directly within threshold
or can also help with those isolated particles not influencing the velocity field and then after sim you will have droplet float attribute you could possibly use to remove those



I know it's an older thread, but what is particle density referring to here?
Is it the number of particles in the voxel?
I did some tests, but couldn't find that out for sure.
  • Quick Links