[vtkusers] vtkUnstructuredGrid with double precision POINTS

Sophie BOUDAUD sophie.boudaud at cdr.hutchinson.fr
Thu Oct 16 05:36:55 EDT 2008


Hello UserGroup,

I'm working on Windows and I'm using TclPro1.4 and VTK4.2.
I'm using vtkUnstructuredGridReader  to  read a VTK file :

                vtkUnstructuredGridReader Ureader
                        Ureader SetFileName $file

Next  a vtkUnstructuredGrid object is created to insert or delete points 
or cells :

                vtkUnstructuredGrid usgModel
                        usgModel DeepCopy [Ureader GetOutput]
                        ...

Then I'm writing a new VTK file using vtkUnstructuredGridWriter :
 
vtkUnstructuredGridWriter uwriter1
                uwriter1 SetInput usgModel
                uwriter1 SetFileTypeToASCII
                uwriter1 SetFileName  $file
                uwriter1 Write

I want to keep the double precision for the POINTS coordinates but 
coordinates are truncated when the file is reading.

The reading VTK file is : 

# vtk DataFile Version 3.0

ASCII
DATASET UNSTRUCTURED_GRID
POINTS  37466 float
   -0.1214999924E+03    -0.3000000000E+03     0.8236390114E+01
   -0.1214999847E+03    -0.3000000000E+03     0.1123638916E+02
....
CELLS    69889  378041
 1 597
 1 598
...
CELL_TYPES      69889
       1
       1
...
CELL_DATA  69889
SCALARS MATERIAL float
LOOKUP_TABLE default
       1
       1
...
SCALARS GROUP float
LOOKUP_TABLE default
       1
       1
...


If POINTS are double :

# vtk DataFile Version 3.0

ASCII
DATASET UNSTRUCTURED_GRID
POINTS  37466 double
   -0.1214999924E+03    -0.3000000000E+03     0.8236390114E+01
   -0.1214999847E+03    -0.3000000000E+03     0.1123638916E+02
....

A VTK error occurs when DeepCopy method is used : 

ERROR: In C:\martink\vtk42\VTK\Common\vtkPoints.cxx, line 261
vtkPoints (0x0518D418): Number of components is different...can't copy


Does anybody help me ?
Thank you in advance.

Sophie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081016/ef622c25/attachment.htm>


More information about the vtkusers mailing list