Hi all,
I'm new to Houdini. I'm wondering how to delete duplicate data?
My final aim is to get 0.16, 0.33, 0.66 only.
How to delete duplicate data?
648 5 1- xrxixe
- Member
- 1 posts
- Joined: 7月 2024
- Offline
- Enivob
- Member
- 2625 posts
- Joined: 6月 2008
- Offline
- RGaal
- Member
- 143 posts
- Joined: 6月 2024
- Offline
Enivob
Data is associated with the context where you created it. I'll assume you added those values to the point context. To remove the additional data, just delete points.
I think the author meant an algorithm for removing duplicates and leaving only points with unique values. As far as I remember, there are no such ready-made functions for removing duplicates in Vex? Only through the for loop you need to make an algorithm, as it seems to me.
- alexwheezy
- Member
- 297 posts
- Joined: 1月 2013
- Offline
You could just mark duplicates found and then delete those points or follow some other logic to exclude them from processing. And of course you need to sort the points by the area attribute.
Run Over: Detail(only once)
Run Over: Detail(only once)
float first = point(0, "area", 0); for(int i = 1; i < npoints(0); ++i){ float value = point(0, "area", i); if(abs(first - value) <= 1e-5){ setpointattrib(0, "del", i, 1); }else{ first = value; } }
Edited by alexwheezy - 2024年9月10日 12:42:08
- AslakKS
- Member
- 185 posts
- Joined: 2月 2016
- Offline
- RGaal
- Member
- 143 posts
- Joined: 6月 2024
- Offline
AslakKSYou are a genius! We completely forgot about this wonderful function in fuse!
Or use the fuse node in match attribute mode and disable the `snap distance` & `output position`. That would only keep one of each valueImage Not Found
But I will note, if the points are connected, then you need to disable "remove point from degenerate prim" otherwise the remaining points will disappear and you will not understand what happened.
-
- Quick Links