Best way to kill lone particles in FLIP sim?

   864   3   2
User Avatar
Member
1 posts
Joined: May 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 - Oct. 31, 2023 19:17:49

Attachments:
flip_sim.PNG (4.5 MB)

User Avatar
Member
685 posts
Joined: Feb. 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 - Nov. 1, 2023 08:17:43
User Avatar
Member
8602 posts
Joined: July 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
FX Supervisor
Method Studios, NY
User Avatar
Member
4533 posts
Joined: Feb. 2012
Online
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]

youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
  • Quick Links