
RenderViewMesh = ps.CreateView("RenderView")

MapTexture2Plane = ps.TextureMaptoPlane(registrationName="TM2P_mesh", Input=tp_mesh) # Filter for showing the ImageData to a plane # link the vtkImageData object to the proxy manager MyMeshClient = tp_mesh.GetClientSideObject() Tp_mesh = ps.TrivialProducer(registrationName="tp_mesh") # TrivialProducer to interface ParaView to serverside objects MyMesh.GetCellData().SetActiveScalars(scalarsvtk.GetName()) # myMesh.GetCellData().SetScalars(scalarsvtk) # do not use this in ParaView!!ĬolorArrayID = myMesh.GetCellData().AddArray(scalarsvtk) Scalarsnp] = np.array(, dtype=np.ubyte) # yellow But I am not sure and am completely lost in the Paraview documentation.Ī minimum working example (which could be used for a github/paraview/examples page, sort of like VTK): from paraview import simple as ps The question is, at which point of the above pipeline is it possible to use Paraview, if at all?įrom my very limited understanding on the subject, I think it is possible to generate a proxy out one of the aforementioned objects (using rvermanager maybe?) and then use. Now if I were to use pure VTK, I’d create a mapper, an actor and render everything to a window. # generate a vtkPolyData from the vtkImageData MyMesh.GetCellData().SetScalars(scalarsvtk) # myMesh.AllocateScalars(vtk.VTK_UNSIGNED_CHAR, 3) # set 3 scalars per cell # Not sure why the following line is not necessary (tested using VTK) # allocate the scalars to the vtkImageData object Scalarsvtk = numpy_to_vtk(scalarsnp, deep=1, array_type=vtk.VTK_UNSIGNED_CHAR) Scalarsnp = np.tile(blue, (myMesh.GetNumberOfCells(), 1)) # Create an image (this is a data object)īlue = np.array(, dtype=np.ubyte)

import numpy as npįrom _support import numpy_to_vtkįrom vtk import vtkImageDataGeometryFilter # this isn't in paraview.vtk
PARAVIEW VTK PYTHON MANUAL HOW TO
Understanding data”, but it is never shown how to use use it directly. This type of object is mentioned in the ParaView Guide in “3. How does one create a simple 2D mesh plot using ParaView from a vtkImageData object.
