[vtk-developers] Changes to VTK for double
Ken Martin
ken.martin at kitware.com
Thu Nov 27 07:55:40 EST 2003
To give you a warning I have started making the double API changes to VTK.
In a nutshell the problem is that most of VTK's API is based on float which
means that it cannot process doubles without first reducing them to a float
for API calls loosing the range and resolution of the double. The other
problem is that float is used for most of our calculaitons. This further
restricts the range of data VTK can handle. For example, if you load a
volume with large spacing most of the 3D widgets will fail with a volume
size (in world coordinates not dimensions) of just 1.0e9. This is because
many of these widgets perform cross products or multiplications of their
bounds. In many cases the results are then mutliplied resulting in bounds to
the forth power. Since the range of float is ~1e39 a float larger than ~3e9
to the forth power will overflow. This type of operation is all over VTK I
just used the widgets as an example. To solve this we need to change the
calculation types to be double and the API to be double just to handle a
reasonable range of float much less to really handle double. (some of the
higher order calculations etc are passed through the API) My goal when I am
done is that VTK can safely handle data on the order of magnitude of +-
1e-75 to 1e75 (basically the forth root of the range of a double). I am
going to try to do these double changes in steps although a change in one
file tends to cascade to others. I'll try to keep VTK running and passing
tests during this transition. But please be aware that if you are building
on top of the CVS version of VTK you may have to change some of your VTK
calls to pass/take double as you compile over the next week or two. I'll
apologize in advance for the pain.
Thanks
Ken
More information about the vtk-developers
mailing list