catch {load vtktcl} # get the interactor ui # source ../../examplesTcl/vtkInt.tcl # Create the RenderWindow, Renderer and Actor(s) vtkRenderer ren1 vtkRenderWindow renWin renWin AddRenderer ren1 # vtkRenderWindowInteractor iren # iren SetRenderWindow renWin # create data vtkFloatPoints points points InsertPoint 0 0.0 0.0 0.0 points InsertPoint 1 0.0 1.0 0.0 points InsertPoint 2 1.0 0.0 0.0 points InsertPoint 3 1.0 1.0 0.0 points InsertPoint 4 2.0 0.0 0.0 points InsertPoint 5 2.0 1.0 0.0 points InsertPoint 6 3.0 0.0 0.0 points InsertPoint 7 3.0 1.0 0.0 vtkCellArray order order InsertNextCell 8;#number of points order InsertCellPoint 0 order InsertCellPoint 1 order InsertCellPoint 2 order InsertCellPoint 3 order InsertCellPoint 4 order InsertCellPoint 5 order InsertCellPoint 6 order InsertCellPoint 7 vtkPolyData profile profile SetPoints points profile SetLines order vtkPolyDataMapper map map SetInput profile vtkActor strip strip SetMapper map [strip GetProperty] SetColor 0 0 0 # Add the actor(s) to the renderer, set the background and size ren1 AddActor strip ren1 SetBackground 1 1 1 renWin SetSize 500 500 renWin Render # render the image to a ppm file # renWin SetFileName "strip.ppm" # renWin SaveImageAsPPM # render the image # iren SetUserMethod {wm deiconify .vtkInteract} # prevent the tk window from showing up then start the event loop wm withdraw .