Remove duplicate points based on attribute?

   3814   3   2
User Avatar
Member
3 posts
Joined: Nov. 2022
Offline
Hi guys,

I'm new in Houdini and I'm trying to remove any duplicate points based on the attribute value.

I've created a custom attribute called 'index' assigned to different objects generated from a foreach loop. Because I'm working with the heightfield, I've converted in mesh and selected some points troughtout the bounding box in group and blasted everything else.
Now, because the bouding box take more than 1 point each index, I need to blast any additional points and keep only 1 point x index.

Consider that I need it porcedural for an HDA.



Thank you very much to anybody wanna help me to resolve this riddle

Cheers,
Davide

Attachments:
points in index.png (46.3 KB)

User Avatar
Member
9384 posts
Joined: July 2007
Offline
something like this will keep just first occurrence of each index value
int first_ptnum = findattribval(0, "point", "index", i@index);
if (@ptnum != first_ptnum) removepoint(0, @ptnum, 1);
Tomas Slancik
CG Supervisor
Framestore, NY
User Avatar
Member
3 posts
Joined: Nov. 2022
Offline
Thank you very much Tomas!
I've eventually found an alternative using the extract centroid node but your way is exact what I was looking for.
User Avatar
Member
291 posts
Joined: Feb. 2016
Offline
Another technique would be to use the fuse node with "Match Attribute"



With fuse you also get a lot of tools to manage how things merge. A real powerhouse

Attachments:
houdinicore_ekabULOqd0.png (638.5 KB)

  • Quick Links