[vtkusers] VTK 3D Structured Grid Problem

Andrea Gavana andrea.gavana at polymtl.ca
Wed Jul 7 13:05:56 EDT 2004


Thank you Tom for your interest in my question...

>Our group had a similar problem. We created a C++ based VTK object that
>was derived from a vtkRectilinearGridSource and produced a
>vtkRectilinearGrid as output, and it sped things up considerably. Of
>course in your case you'd want to derive from vtkStructuredGrid, etc...

Unfortunately, I'm not really a guru of C/C++ (I do not know almost anything 
about it...), and anyway, probably I will not be able to link C/C++ with Python 
(I've never done it).

>>idx = 0
>>for i in range(0,2*nz):
>>        for j in range(0,2*ny):
>>                for i in range(0,2*nx):
       ^^^^^^^
>>                    pts.SetPoint(idx, nanna[0,idx], nanna[1,idx], nanna
[2,idx])
>>                    idx = idx + 1        

>you realize you're using the 'i' as an index twice, right? I'm not
>a python expert but you should be sure this is what you want.

Thanks Tom, it was my mistake... the results didn't change, anyway. It is still 
slow...

Thanks to everyone for any other suggestion.

Andrea.



More information about the vtkusers mailing list