<s> import vtk <EOL> from vtk . util . colors import chocolate , mint <EOL> cone = vtk . vtkCone ( ) <EOL> cone . SetAngle ( <NUM_LIT:20> ) <EOL> vertPlane = vtk . vtkPlane ( ) <EOL> vertPlane . SetOrigin ( <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> vertPlane . SetNormal ( - <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> basePlane = vtk . vtkPlane ( ) <EOL> basePlane . SetOrigin ( <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> basePlane . SetNormal ( <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> iceCream = vtk . vtkSphere ( ) <EOL> iceCream . SetCenter ( <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> iceCream . SetRadius ( <NUM_LIT:0.5> ) <EOL> bite = vtk . vtkSphere ( ) <EOL> bite . SetCenter ( <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT:0.5> ) <EOL> bite . SetRadius ( <NUM_LIT> ) <EOL> theCone = vtk . vtkImplicitBoolean ( ) <EOL> theCone . SetOperationTypeToIntersection ( ) <EOL> theCone . AddFunction ( cone ) <EOL> theCone . AddFunction ( vertPlane ) <EOL> theCone . AddFunction ( basePlane ) <EOL> theCream = vtk . vtkImplicitBoolean ( ) <EOL> theCream . SetOperationTypeToDifference ( ) <EOL> theCream . AddFunction ( iceCream ) <EOL> theCream . AddFunction ( bite ) <EOL> theConeSample = vtk . vtkSampleFunction ( ) <EOL> theConeSample . SetImplicitFunction ( theCone ) <EOL> theConeSample . SetModelBounds ( - <NUM_LIT:1> , <NUM_LIT> , - <NUM_LIT> , <NUM_LIT> , - <NUM_LIT> , <NUM_LIT> ) <EOL> theConeSample . SetSampleDimensions ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> theConeSample . ComputeNormalsOff ( ) <EOL> theConeSurface = vtk . vtkContourFilter ( ) <EOL> theConeSurface . SetInputConnection ( theConeSample . GetOutputPort ( ) ) <EOL> theConeSurface . SetValue ( <NUM_LIT:0> , <NUM_LIT:0.0> ) <EOL> coneMapper = vtk . vtkPolyDataMapper ( ) <EOL> coneMapper . SetInputConnection ( theConeSurface . GetOutputPort ( ) ) <EOL> coneMapper . ScalarVisibilityOff ( ) <EOL> coneActor = vtk . vtkActor ( ) <EOL> coneActor . SetMapper ( coneMapper ) <EOL> coneActor . GetProperty ( ) . SetColor ( chocolate ) <EOL> theCreamSample = vtk . vtkSampleFunction ( ) <EOL> theCreamSample . SetImplicitFunction ( theCream ) <EOL> theCreamSample . SetModelBounds ( <NUM_LIT:0> , <NUM_LIT> , - <NUM_LIT> , <NUM_LIT> , - <NUM_LIT> , <NUM_LIT> ) <EOL> theCreamSample . SetSampleDimensions ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> theCreamSample . ComputeNormalsOff ( ) <EOL> theCreamSurface = vtk . vtkContourFilter ( ) <EOL> theCreamSurface . SetInputConnection ( theCreamSample . GetOutputPort ( ) ) <EOL> theCreamSurface . SetValue ( <NUM_LIT:0> , <NUM_LIT:0.0> ) <EOL> creamMapper = vtk . vtkPolyDataMapper ( ) <EOL> creamMapper . SetInputConnection ( theCreamSurface . GetOutputPort ( ) ) <EOL> creamMapper . ScalarVisibilityOff ( ) <EOL> creamActor = vtk . vtkActor ( ) <EOL> creamActor . SetMapper ( creamMapper ) <EOL> creamActor . GetProperty ( ) . SetColor ( mint ) <EOL> ren = vtk . vtkRenderer ( ) <EOL> renWin = vtk . vtkRenderWindow ( ) <EOL> renWin . AddRenderer ( ren ) <EOL> iren = vtk . vtkRenderWindowInteractor ( ) <EOL> iren . SetRenderWindow ( renWin ) <EOL> ren . AddActor ( coneActor ) <EOL> ren . AddActor ( creamActor ) <EOL> ren . SetBackground ( <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> renWin . SetSize ( <NUM_LIT> , <NUM_LIT> ) <EOL> ren . ResetCamera ( ) <EOL> ren . GetActiveCamera ( ) . Roll ( <NUM_LIT> ) <EOL> ren . GetActiveCamera ( ) . Dolly ( <NUM_LIT> ) <EOL> ren . ResetCameraClippingRange ( ) <EOL> iren . Initialize ( ) <EOL> renWin . Render ( ) <EOL> iren . Start ( ) </s>
