[vtkusers] Re: What's Wrong With This?!?

Goodwin Lawlor goodwin.lawlor at ucd.ie
Thu Mar 23 14:21:15 EST 2006


Hi Andrea,

Andrea Gavana wrote:
<snip>
>  
> This line says:
>  
>   for(int j=0; j < this->NumberOfComponents; ++j)
>     {
>     this->Tuple[j] = static_cast<double>(t[j]);
>     }
>   return this->Tuple;
>  
>  
> 2) Doing the 2-steps method:
>  
> a) vtks = pyvtk.VtkData(pyvtk.StructuredGrid([nx, ny, nz], MyMatrix))
>     vtks.tofile("MyFile.vtk", "ascii")
>  
> b) grid = vtk.vtkStructuredGridReader()
>     grid.SetFileName("MyFile.vtk")
>     surfaceMapper = vtk.vtkDataSetMapper()
>     surfaceMapper.SetInput(grid.GetOutput())
>  
> works: VTK doesn't crash. But this method may become very slow if I 
> have, say, 200,000 cells or more (and I have them)...
>  
> Is there other things I could try?

Try your scripts using doubles (vtkDoubleArray) instead of floats... 
worth a go. I see the exception is happening when the array value is 
getting cast.

hth

Goodwin




More information about the vtkusers mailing list