Wait seems like TrivialProducer is what I’m looking for
I’m just getting started with Paraview and was hoping to experiment with generating polydata programmatically to view in Paraview just to get some shapes to work with that I can mess around with. I stumbled on the Live Programmable Source and an article showing how to create things with it in the GUI (https://cvw.cac.cornell.edu/ParaViewAdv/progsource). I was wondering if there’s a way to write the following in the paraview python shell instead of Programmable Live Source and have a render of it appear in the View.
import paraview.vtk as vtk points = vtk.vtkPoints() points.InsertPoint(0, 0, 0, 0) points.InsertPoint(1, 1, 0, 0) points.InsertPoint(2, 0, 1, 0) points.InsertPoint(3, 0, 0, 1) pdo = vtk.vtkPolyData() triangle = vtk.vtkPolygon() triangle.GetPointIds().SetNumberOfIds(3) tris = [[0,1,2], [0,2,3], [0,3,1], [1,3,2]] for t in range(0, 4): for p in range(0, 3): triangle.GetPointIds().SetId(p, tris[t][p]) pdo.InsertNextCell(triangle.GetCellType(), triangle.GetPointIds())
I’ve tried to run
Render() after all this but I suppose since I don’t have a source representing the polydata there’s no reason to believe those would have worked. Thanks for anyone who can suggest how I would make this
pdo variable visible.