[vtkusers] vtkMultiBlockMergeFilter.merge() python

jwvgoethe rcloud at gmail.com
Tue May 31 20:23:52 EDT 2011


Hello I'm trying to merge several blocks into one, but the documentation on
the merge function is rather sparse. Actually I have found the documentation
in general a bit terse, especially for a non native English speaker.

Could someone tell me if I am on the right track? The ultimate goal of my
project is to read in some LSDyna data, extract the blocks, merge them,
apply a filter, and then export them as a vtk set.


reader= vtk.vtkLSDynaReader()
reader.SetDatabaseDirectory('.')
reader.Update()
outputPort = reader.GetOutputPort
numTimeSteps= reader.GetNumberOfTimeSteps()

LSDynaOutput = reader.GetOutput()

num_blocks =  LSDynaOutput.GetNumberOfBlocks()
blocks = []

extractor = vtk.vtkExtractBlock()
extractor.SetInputConnection(0, reader.GetOutputPort(0))

#what do we do here? just add the indices?
for i in range(num_blocks):
   extractor.AddIndex(i)

merger = vtk.vtkMultiBlockMergeFilter()
merger.setInputConnection(0, extractor.GetOutputPort(0))
output = vtk.vtkMultiBlockDataSet()

here I assume I would use the merge function of vtkMultiBlockMergeFilter but
I am slightly confused as to how to go about doing it. If I am doing
something incorrect in the above code it would be very much appreciated for
correction.

--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkMultiBlockMergeFilter-merge-python-tp4443738p4443738.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list