Greetings,
I am using an algorithm to process points from a point cloud that requires me to iterate over all the points twice (unfortunately). So, this begs the question: What is the proper way of resetting or restarting a pciterate loop? Do I have to close the handle (pcclose), and reopen the point again or is there some other way to simply loop again without having to pcclose/pcopen again? (To call the pcopen twice seems…unnecessary.)
Regards,
Van Aarde.
VEX: 'reset' a pciterate loop
5494 6 1- nanocell
- Member
- 10 posts
- Joined: Sept. 2008
- Offline
- wolfwood
- Member
- 4271 posts
- Joined: July 2005
- Offline
- nanocell
- Member
- 10 posts
- Joined: Sept. 2008
- Offline
Hi Wolfwood,
Thanks for the reply .
I wasn't saying (or thinking) that theres anything wrong with doing it that way. I was merely trying to find it if there is a more *optimal* way of doing it.
Now, I not familiar with the internal workings of the point cloud functions so this is how I picture it would work:
pcopen() looks up a bunch of points within the specified radius from a given point. These points are stored in memory (??) and an pciterate can be used to iterate over them. Now, to iterate over them a second time, I would have to close the handle, pcopen() again (which does the whole lookup thing again), stores the points in memory and only then I iterate over them again.
All I want to do is iterate over the points without having to do the pcopen lookup again: something like:
pcreset(handle); <– reset the iterator to the beginning of the list.
Unless, of course, if the pcopen/pciterate functions are so super optimal that it is not necessary at all…then I'm okay with it .
Thanks for the reply .
I wasn't saying (or thinking) that theres anything wrong with doing it that way. I was merely trying to find it if there is a more *optimal* way of doing it.
Now, I not familiar with the internal workings of the point cloud functions so this is how I picture it would work:
pcopen() looks up a bunch of points within the specified radius from a given point. These points are stored in memory (??) and an pciterate can be used to iterate over them. Now, to iterate over them a second time, I would have to close the handle, pcopen() again (which does the whole lookup thing again), stores the points in memory and only then I iterate over them again.
All I want to do is iterate over the points without having to do the pcopen lookup again: something like:
pcreset(handle); <– reset the iterator to the beginning of the list.
Unless, of course, if the pcopen/pciterate functions are so super optimal that it is not necessary at all…then I'm okay with it .
- wolfwood
- Member
- 4271 posts
- Joined: July 2005
- Offline
- jacob clark
- Member
- 665 posts
- Joined: July 2005
- Offline
- Mario Marengo
- Member
- 941 posts
- Joined: July 2005
- Offline
nanocell
pcopen() looks up a bunch of points within the specified radius from a given point. These points are stored in memory (??) and an pciterate can be used to iterate over them. Now, to iterate over them a second time, I would have to close the handle, pcopen() again (which does the whole lookup thing again), stores the points in memory and only then I iterate over them again.
I don't know the details of how pcopen() was implemented either, but I'm guessing it just builds a new kd-tree on the same point data. It seems you're thinking about always using a single handle for both iterations, but you shouldn't (at least not if they're nested). Anyway… I had posted some more information in your odForce incarnation of this thread [forums.odforce.net] (sorry, didn't know you'd posted here as well).
- nanocell
- Member
- 10 posts
- Joined: Sept. 2008
- Offline
My intention was actually to use the loops sequentially (not nested). I would never use the same iterator fo a nested loop! Blasphemy! I'll specify it next time.
Nevertheless. I double posted, here (for Houdini developer input on the pcopen implementation) and on odForce for any other advice .
Okay, back to odForce!
Nevertheless. I double posted, here (for Houdini developer input on the pcopen implementation) and on odForce for any other advice .
Okay, back to odForce!
-
- Quick Links