-
Vtk Example Cylinder (for python)
각진 cylinder를 만들고, Filter처리 없이 간단히 Mapper로 넘겨서, rendering하는 예제.
import vtk # This creates a polygonal cylinder model. cylinderData = vtk.vtkCylinderSource() # The mapper is responsible for pushing the geometry into the graphics. cylinderMapper = vtk.vtkPolyDataMapper() cylinderMapper.SetInputConnection(cylinderData.GetOutputPort()) # ready to rendering cylinderActor = vtk.vtkActor() cylinderActor.SetMapper(cylinderMapper) # Create the graphics structure. # The render window interactor captures mouse events, # camera or actor manipulation depending. rd = vtk.vtkRenderer() rdw = vtk.vtkRenderWindow() rdw.AddRenderer(rd) rdi = vtk.vtkRenderWindowInteractor() rdi.SetRenderWindow(rdw) # Add the actors to the renderer rd.AddActor(cylinderActor) # This allows the interactor to initalize itself. # called before an event loop. rdi.Initialize() # camera setting rd.ResetCamera() rdw.Render() # Start the event loop. rdi.Start()
'Vtk' 카테고리의 다른 글
Vtk VisualizationPipeline (0) 2021.03.09 Vtk Process object (처리 객체) (0) 2021.03.09 Vtk Mapper object (매퍼 객체) (0) 2021.03.09 Vtk 설치(Python) (0) 2021.03.09 Vtk Data object (데이터 객체) (0) 2021.03.08 VTK(The Visualization Toolkit) (0) 2021.02.24