ote

ote

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

[HDK] removing duplicates points May 25, 2012, 8:56 a.m.

Thanks for the idea, but using this functions ends up by deleting all the points after a couple of hours of computations !

Some precision on my problem : the data that I need to process is only made of points, there is no primitives using those points.

[HDK] removing duplicates points May 24, 2012, 11:29 a.m.

Hi,

I'm creating a SOP and having some difficulties to remove duplicates points (based on their coordinates). I have to deal with possibly a lot of points (up to a million) and in that case my code is taking too much time (more than a half hour for removing around 2500 duplicates from 870 000 points). I've so far been using unordered_set from STL with the creation of appropriate hash function and overloading operator== (or at least I think I have ;p) but I'm searching some fastest way to do that.

I've discover sortAndRemoveDuplicates() in UT_PtrArray.h while browsing the HDK classes, but it is not doing anything to my points when I call it like that :

GEO_PointList myPoints = gdp->points();
myPoints.sortAndRemoveDuplicates();
Am I missing something ? The comment above that function does not say much. Anyone ever having to deal with that problem has an idea/piece of code to help ?

Thanks

HDK removing duplicate points March 19, 2012, 7:07 a.m.

Hello,

I'm have problem to delete some duplicate points. I have a set of points and some of them have the same coordinates.

For simplicity, let's say I have 6 points, #1 and #3 are at the same place and #0 and #5 also. Just to be clear :
[imageshack.us]

I create 2 closed GEO_PrimPoly, one with points #2, 5 and 4 and the second with 4, 3 and 2. From that point, the triangles are at their “right” place. But then, I delete points #0 and 1 (gdp->deletePoint(#ofPOintToRemove, 1)) and the 2 triangles are broken :
[imageshack.us]

It seems that houdini is modifying the point number in order to avoid discontinuity but without updating the poly's vertex numbers. Or I'm doing something wrong ?

I've tried to use fastConsolidatePoints(), but I find this call to be kind of slow and redondant because in my algorithm I'm already searching for duplicate points and I know the index of the points not being use in any polys.