[vtk-developers] Re: vtkOBBTree sqrt domain err

David Gobbi dgobbi at atamai.com
Mon Nov 28 14:51:29 EST 2005


Mathieu Malaterre wrote:

> Dean Inglis wrote:
>
>> Hi David,
>>
>> the assertion fails! I added a debug macro
>> and found that if:
>> rangeAmin = -nan
>> rangeAmax = -nan
>>
>> then the difference is -nan
>>
>> and the sqrt function conks out with a
>> domain error.  Perhaps the vectors being dotted
>> are not being initialized in some cases???
>
>
> Or you divide by zero...
> I know how to turn FPE with gcc and VS but not for borland...

The ComputeOBB() method on line 270 computes a value called
"tot_mass" and then divides a bunch of values by it.  It looks like
"tot_mass" is zero if no triangles can be generated from the data
set, or if the triangles are degenerate.

So apparently vtkOBBTree will crash and burn if it is given data sets
that cannot be turned into triangles.  Dean, do you think that any
of the data sets that you are giving to OBBTree might not have
any polygons?

 - David



More information about the vtk-developers mailing list