InverseTampere / TreeQSM

Quantitative Structure Models of Single Trees from Laser Scanner Data
Other
140 stars 45 forks source link

Infinite loop in cubical_partition.m #4

Open peltokukka opened 4 years ago

peltokukka commented 4 years ago

In the while-loop starting at line 48 of cubical_partition.m there is a possibility for an infinite loop:

N = double(ceil((Max-Min)/EL)+2*NE+1);
while 8*N(1)*N(2)*N(3) > 4e9
    EL = 1.1*EL;
    N = double(ceil((Max-Min)/EL)+2*NE+1);
end

The part ceil((Max-Min)/el) approaches [1 1 1] during the loop, but there is a possibility that the remaining part 2*NE+1 takes the product over the while loop limit regardless of EL when NE is large enough (larger than 395 to be exact).

jknappwilson commented 3 years ago

Hello,

I am also running into this same problem that is keeping me from constructing an actual QSM. Any solutions or ideas to fix it? Apologies, matlab is not my strong suit, but I am really interested in this modelling software