Beispiel #1
0
output = pl3d.GetOutput().GetBlock(0)

dst = vtk.vtkDataSetTriangleFilter()
dst.SetInputData(output)

extract = vtk.vtkExtractUnstructuredGridPiece()
extract.SetInputConnection(dst.GetOutputPort())

cf = vtk.vtkContourFilter()
cf.SetInputConnection(extract.GetOutputPort())
cf.SetValue(0, 0.24)

pdn = vtk.vtkPolyDataNormals()
pdn.SetInputConnection(cf.GetOutputPort())

ps = vtk.vtkPieceScalars()
ps.SetInputConnection(pdn.GetOutputPort())

mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(ps.GetOutputPort())
mapper.SetNumberOfPieces(3)

actor = vtk.vtkActor()
actor.SetMapper(mapper)

ren = vtk.vtkRenderer()
ren.AddActor(actor)
ren.ResetCamera()

camera = ren.GetActiveCamera()
# $camera SetPosition 68.1939 -23.4323 12.6465
VTK_DATA_ROOT = vtkGetDataRoot()

math = vtk.vtkMath()
math.RandomSeed(22)

sphere = vtk.vtkSphereSource()
sphere.SetPhiResolution(32)
sphere.SetThetaResolution(32)

extract = vtk.vtkExtractPolyDataPiece()
extract.SetInputConnection(sphere.GetOutputPort())

normals = vtk.vtkPolyDataNormals()
normals.SetInputConnection(extract.GetOutputPort())

ps = vtk.vtkPieceScalars()
ps.SetInputConnection(normals.GetOutputPort())

mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(ps.GetOutputPort())
mapper.SetNumberOfPieces(2)

actor = vtk.vtkActor()
actor.SetMapper(mapper)

sphere2 = vtk.vtkSphereSource()
sphere2.SetPhiResolution(32)
sphere2.SetThetaResolution(32)

extract2 = vtk.vtkExtractPolyDataPiece()
extract2.SetInputConnection(sphere2.GetOutputPort())
Beispiel #3
0
output = pl3d.GetOutput().GetBlock(0)

dst = vtk.vtkDataSetTriangleFilter()
dst.SetInputData(output)

extract = vtk.vtkExtractUnstructuredGridPiece()
extract.SetInputConnection(dst.GetOutputPort())

cf = vtk.vtkContourFilter()
cf.SetInputConnection(extract.GetOutputPort())
cf.SetValue(0, 0.24)

pdn = vtk.vtkPolyDataNormals()
pdn.SetInputConnection(cf.GetOutputPort())

ps = vtk.vtkPieceScalars()
ps.SetInputConnection(pdn.GetOutputPort())

mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(ps.GetOutputPort())
mapper.SetNumberOfPieces(3)

actor = vtk.vtkActor()
actor.SetMapper(mapper)

ren = vtk.vtkRenderer()
ren.AddActor(actor)
ren.ResetCamera()

camera = ren.GetActiveCamera()
# $camera SetPosition 68.1939 -23.4323 12.6465
Beispiel #4
0
VTK_DATA_ROOT = vtkGetDataRoot()

math = vtk.vtkMath()
math.RandomSeed(22)

sphere = vtk.vtkSphereSource()
sphere.SetPhiResolution(32)
sphere.SetThetaResolution(32)

extract = vtk.vtkExtractPolyDataPiece()
extract.SetInputConnection(sphere.GetOutputPort())

normals = vtk.vtkPolyDataNormals()
normals.SetInputConnection(extract.GetOutputPort())

ps = vtk.vtkPieceScalars()
ps.SetInputConnection(normals.GetOutputPort())

mapper = vtk.vtkPolyDataMapper()
mapper.SetInputConnection(ps.GetOutputPort())
mapper.SetNumberOfPieces(2)

actor = vtk.vtkActor()
actor.SetMapper(mapper)

sphere2 = vtk.vtkSphereSource()
sphere2.SetPhiResolution(32)
sphere2.SetThetaResolution(32)

extract2 = vtk.vtkExtractPolyDataPiece()
extract2.SetInputConnection(sphere2.GetOutputPort())