def createTexturedPlane(): source = vtk.vtkPlaneSource() textureMap = vtk.vtkTextureMapToPlane() textureMap.SetInput(source.GetOutput()) textureMap.Update() return shallowCopy(textureMap.GetOutput())
def addPlane(self, origin, normal, width, height, resolution=1, color=[1,1,1]): plane = vtk.vtkPlaneSource() plane.SetOrigin(-width/2.0, -height/2.0, 0.0) plane.SetPoint1(width/2.0, -height/2.0, 0.0) plane.SetPoint2(-width/2.0, height/2.0, 0.0) plane.SetCenter(origin) plane.SetNormal(normal) plane.SetResolution(resolution, resolution) plane.Update() self.addPolyData(plane.GetOutput(), color)
def addPlane(self, origin, normal, width, height, resolution=1, color=[1, 1, 1]): plane = vtk.vtkPlaneSource() plane.SetOrigin(-width / 2.0, -height / 2.0, 0.0) plane.SetPoint1(width / 2.0, -height / 2.0, 0.0) plane.SetPoint2(-width / 2.0, height / 2.0, 0.0) plane.SetCenter(origin) plane.SetNormal(normal) plane.SetResolution(resolution, resolution) plane.Update() self.addPolyData(plane.GetOutput(), color)