Double and Float types of data in VTK files

by Forrest Sheng Bao

I just realized that they are different, at least to python-vtk, the official Python wrapper for VTK library. If a scalar is of type Float, python-vtk will pad many digits after the decimal point. For example, 205187 in a pure ASCII VTK file becomes 0.20518699288368225. All Float data are padded to the 16-th digit after decimal point. However, if the type is Double, no such a problem.

I don't know what VTK's semantics for Double and Float are. But it should be related.

I am using python-vtk and Python2.7 that comes with Ubuntu Linux 11.10 64bit.

No comments: