MantisBT - ParaView | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0015889 | ParaView | (No Category) | public | 2015-12-17 05:48 | 2016-07-22 19:22 |
| Reporter | Nico Schlömer | ||||
| Assigned To | T.J. Corona | ||||
| Priority | normal | Severity | minor | Reproducibility | have not tried |
| Status | closed | Resolution | fixed | ||
| Platform | OS | OS Version | |||
| Product Version | |||||
| Target Version | Fixed in Version | ||||
| Project | TBD | ||||
| Topic Name | |||||
| Type | incorrect functionality | ||||
| Summary | 0015889: classic vtk files written with wrong data type (single instead of double) | ||||
| Description | When writing double-precision data into a (legacy) VTK file, only single-precision is written out. MWE: ``` import numpy numpy.set_printoptions(precision=20) import vtk from vtk.util import numpy_support mesh = vtk.vtkUnstructuredGrid() # add points to mesh points = numpy.array([[0.1234567890123456789, 0.0, 0.0]]) print(points) vtk_points = vtk.vtkPoints() vtk_array = numpy_support.numpy_to_vtk(points) print(vtk_array) p2 = numpy_support.vtk_to_numpy(vtk_array) print(p2) vtk_points.SetData(vtk_array) mesh.SetPoints(vtk_points) # write to VTK writer = vtk.vtkUnstructuredGridWriter() writer.SetFileTypeToASCII() writer.SetFileName('test.vtk') writer.SetInputData(mesh) writer.Write() ``` This gives the file ``` # vtk DataFile Version 4.0 vtk output ASCII DATASET UNSTRUCTURED_GRID POINTS 1 double 0.123457 0 0 CELL_TYPES 0 ``` The points array is cut short with `0.123457`, seemingly a single precision float. | ||||
| Steps To Reproduce | |||||
| Additional Information | |||||
| Tags | Hackathon-July-2016 | ||||
| Relationships | |||||
| Attached Files | |||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2015-12-17 05:48 | Nico Schlömer | New Issue | |||
| 2016-07-12 11:48 | Utkarsh Ayachit | Tag Attached: Hackathon-July-2016 | |||
| 2016-07-13 14:34 | T.J. Corona | Assigned To | => T.J. Corona | ||
| 2016-07-13 14:34 | T.J. Corona | Status | backlog => active development | ||
| 2016-07-13 14:34 | T.J. Corona | Resolution | open => fixed | ||
| 2016-07-13 15:24 | T.J. Corona | Note Added: 0036403 | |||
| 2016-07-13 15:24 | T.J. Corona | Status | active development => gatekeeper review | ||
| 2016-07-14 15:36 | T.J. Corona | Note Added: 0036475 | |||
| 2016-07-14 15:36 | T.J. Corona | Status | gatekeeper review => customer review | ||
| 2016-07-22 19:22 | Alan Scott | Note Added: 0036550 | |||
| 2016-07-22 19:22 | Alan Scott | Status | customer review => closed | ||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||