[Sidefx-houdini-list] Stopping a For Each SOP

Nick Nimble nick at nicknimble.com
Sat Jan 5 04:38:14 EST 2013

Well what I'm doing is use iterations to speedup pointcloud lookups on 
vast numbers of points. The goal is to get a good result with finding a 
closest point that is not taken between two sets of a 1.000.000 points 
for every point. I use this to seamless blend a FLIP fluid to a very 
specific shape, in slowmotion. So there is nowhere to hide.

I came a long way, it now takes 18 secs to mary up two sets of 10.000 
points, but the two large sets take about 14 hours now, where its is in 
the stage of still processing the 'I'm done and skipping most of the 
stuff' iterations.

The idea is to predict how many neighbor points are needed in a given 
pointcloud lookup to get to a good result. I use a gamma (power 2) curve 
0 -1 that is used as a fraction of the total number of points. Because 
it ends with 1 every point will find a 'partner' eventually. How this 
works is that I exclude all matches from previous iterations through 
groups from future iterations. This works very well and for the 10.000 
points where I use 100 iterations. much more that that doesn't seem to 
make much of a difference. 10 iterations seemed the very effective on a 
1000 points so that is how I got to the total number of points / 100 is 
the number of iterations.

How ever sometimes there are no points left before the last iteration. 
Which is awesome, but this is how I got to the point where I wanted to 
break from the loop at a given point.

I realize I have to get get a better figure at how many iterations are 
needed. Because in the example to 1.000.000 points, if the 'nothing left 
to do skipping most of it step' takes 3 sec per iteration which is not 
to bad on a total of 14 hours ;-). Although if it succeeds half way 
through (total of 10000 iterations) it still takes 4 hours to get 
through all that.

I guess more testing is the best method. I'm also going to run the same 
tests with just a cap on the total number of neighbor points. Just to 
see if I can get away when using enough iterations with say 100 
neighbors max. It seems that a relative wider range of neighbors is 
essential for point clouds with a low density, but it just might be that 
you hardly notice the difference on very high density pointclouds.

Nick, be Nimble
+31 622 4243 94 | www.nicknimble.com | www.facebook.com/nicknimble

On 1/4/13 11:14 PM, Stephen Tucker wrote:
> Not sure if I'm guessing what you're doing correctly, but maybe there's a
> better way to calculate the number of times you need to run the loop than
> manually entering in the x value?
> On Fri, Jan 4, 2013 at 10:33 AM, Nick Nimble <nick at nicknimble.com> wrote:
>> Hi Andrew,
>> Well I'm not sure if its the ideal method, but it works very well for my
>> purpose. I'm very grateful :-).
>> Today's paradox: 'Sometimes the solution is so simple that its overlooked'
>> ;-)
>> Cheers,
>> Nick, be Nimble
>> +31 622 4243 94 | www.nicknimble.com | www.facebook.com/nicknimble
>> On 1/4/13 6:39 PM, Andrew Lyons wrote:
>>> not sure on getting correct break behavior (SESI?) - but perhaps using a
>>> switch SOP in your foreach to output null for those iterations where
>>> there's nothing to be done could at least eliminate compute time ... ?
>>> Cheers
>>> On 4 January 2013 09:34, Nick Nimble <nick at nicknimble.com> wrote:
>>>   Hi :-)
>>>> I'm having a for each sop that iterates over geometry. aka I it goes over
>>>> the same set of points an x number of times.
>>>> It happens that halfway trough the iterations 'there is noting left to
>>>> do'
>>>> and I would like to exit/break from the loop. Very common in
>>>> scripting/programming, right?
>>>> I noticed the 'Stop Condition' parm on the for each node. Lovely when you
>>>> want to stop at a given iteration using the stamp expression. How ever
>>>> when
>>>> you refer to anything that lives inside, like the number of points in a
>>>> group, it seems to dive into an endless loop.
>>>> My question is, is there a node that I can use inside a for each SOP to
>>>> 'break' from the iterations?
>>>> Any suggestions are more than appreciated :-)
>>>> --
>>>> Cheers,
>>>> Nick, be Nimble
>>>> +31 622 4243 94 | www.nicknimble.com | www.facebook.com/nicknimble
>>>> ______________________________****_________________
>>>> Sidefx-houdini-list mailing list
>>>> Sidefx-houdini-list at sidefx.com
>>>> https://lists.sidefx.com:443/****mailman/listinfo/sidefx-****
>>>> houdini-list<https://lists.sidefx.com:443/**mailman/listinfo/sidefx-**houdini-list>
>>>> <https://lists.**sidefx.com:443/mailman/**listinfo/sidefx-houdini-list<https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list>
>> ______________________________**_________________
>> Sidefx-houdini-list mailing list
>> Sidefx-houdini-list at sidefx.com
>> https://lists.sidefx.com:443/**mailman/listinfo/sidefx-**houdini-list<https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list>

More information about the Sidefx-houdini-list mailing list