Remove less adjacent points

   621   1   0
User Avatar
Member
8 posts
Joined: 3月 2022
Offline
I'm creating a particle advection sim. How can I remove the points that are less adjacent?

Attachments:
Snap.png (800.2 KB)

User Avatar
Member
4512 posts
Joined: 2月 2012
Offline
Hi,

You can do this using a Point Wrangle:

int maxpts = chi("maxpts");
int pts [ ] = pcfind ( 0, "P", @P, ch("radius"), maxpts );
if ( len ( pts ) >= maxpts )
    removepoint ( 0, @ptnum );

For more complex geometry, you can do it iteratively:



But it gets a bit more involved to set this up from scratch compared to the above VEX code.
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 | animatrix2k7.gumroad.com
  • Quick Links