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.
Found 5 posts.
Search results Show results as topic list.
Technical Discussion » [HDK] removing duplicates points
- ote
- 5 posts
- Offline
Technical Discussion » [HDK] removing duplicates points
- ote
- 5 posts
- Offline
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
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
Technical Discussion » HDK removing duplicate points
- ote
- 5 posts
- Offline
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.
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.
Technical Discussion » HDK problem with second input and groups
- ote
- 5 posts
- Offline
Yes, I use SOP_Node::primGroupMenu. This is the line that creates my B field in myTemplateList :
PRM_Template(PRM_STRING, 1, &names, 0, &SOP_Node::primGroupMenu)
I've guessed that I need to indicate somehow that I want to grab the groups from the second input, but I have no idea how to do that.
PRM_Template(PRM_STRING, 1, &names, 0, &SOP_Node::primGroupMenu)
I've guessed that I need to indicate somehow that I want to grab the groups from the second input, but I have no idea how to do that.
Technical Discussion » HDK problem with second input and groups
- ote
- 5 posts
- Offline
Hi,
I'm creating a SOP which can take 2 inputs. In my parameter list, I have 2 strings params (lets say A and B) for giving the name of some groups. A, the first one, takes a point group's name as value. When I connect a point group node to the first input of my SOP, the name of that group is displayed when I click on the grey arrow of A. B can take as well a group name, but it must be a primitive group.
My problem is that when I connect a group node of primitives to the second input, I don't see the name of that group when I click on the arrow of B but, it works if I type the name of the group in the B field. The name of the group is only available in the list if the group is connected to the first input.
Does anybody have an idea how to fix this ?
I'm creating a SOP which can take 2 inputs. In my parameter list, I have 2 strings params (lets say A and B) for giving the name of some groups. A, the first one, takes a point group's name as value. When I connect a point group node to the first input of my SOP, the name of that group is displayed when I click on the grey arrow of A. B can take as well a group name, but it must be a primitive group.
My problem is that when I connect a group node of primitives to the second input, I don't see the name of that group when I click on the arrow of B but, it works if I type the name of the group in the B field. The name of the group is only available in the list if the group is connected to the first input.
Does anybody have an idea how to fix this ?
-
- Quick Links