[vtkusers] How to use vtkStructuredGridGeometryFilter instead of a bunch of cubes
somada141 at yahoo.gr
Fri Nov 14 14:36:20 EST 2008
I am making an FDTD simulation program and at some point I want to plot the
mesh as created by the method. SInce it is an FDTD mesh it is a whole bunch
of cubes in space...
I am attaching a picture of it here :
The problem is that when I do this I create a whole bunch of cube actors one
for each cube showing....However this can get really slow when it comes to
I later found out that this can be done with a vtkStructuredGrid and
vtkStructuredGridGeometryFilter where I create a huge array of cubes and
blank out the ones I dont want shown...
However I cannot understand how to do this...here is an attempt which only
yields points instead of cube wireframes :
from vtk import *
#Creating renderer,window,interactor - See the CMFViewer.py for comments on
how this is done properly. The code here is stuffed in order to save space.
renderer = vtkRenderer();renderer_window =
structured_grid = vtkStructuredGrid()
mesh_points = vtkPoints()
mesh_scalars = vtkFloatArray()
for i in range(3):
for j in range(3):
for k in range(3):
surface_filter = vtkStructuredGridGeometryFilter()
polydata_mapper = vtkPolyDataMapper()
surfActor = vtkActor()
Does anyone know where can I find a decent example of this filter or propose
a better way to do it?
View this message in context: http://www.nabble.com/How-to-use-vtkStructuredGridGeometryFilter-instead-of-a-bunch-of-cubes-tp20507048p20507048.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers