#region sphere __sphere = vtkSphereSource() __sphere.SetRadius(0.15) __sphereglyph = vtkGlyph3D() __sphereglyph.SetSourceConnection(__sphere.GetOutputPort()) __sphereglyph.SetInputData(__unstructured_grid) __sphereglyph.SetVectorModeToUseVector() __sphereglyph.SetColorModeToColorByScalar() __sphereglyph.SetScaleModeToDataScalingOff() __sphereglyph.OrientOn() __sphereglyph.SetScaleFactor(0.2) __sphereactor = vtkActor() __spheremapper = vtkDataSetMapper() __spheremapper.SetInputConnection(__sphereglyph.GetOutputPort()) __spheremapper.SetScalarRange(0.0, 1.0) __spheremapper.ScalarVisibilityOn() __spheremapper.Update() __sphereactor.SetMapper(__spheremapper) #end region sphere renderer = WindowRenderer() renderer.renderer.AddActor(__actor) renderer.renderer.AddActor(__arrowactor) renderer.renderer.AddActor(__sphereactor) renderer.setup_render_window() renderer.start_render_window()
outline_mapper.SetInputConnection(outline_filter.GetOutputPort()) # Set property outline_property.SetColor(0.2, 0.2, 0.2) # Set outline actor outline_actor.SetMapper(outline_mapper) outline_actor.SetProperty(outline_property) # Add actor to the window renderer renderer.AddActor(actor) renderer.AddActor(outline_actor) if __name__ == '__main__': window = WindowRenderer() renderer = window.renderer kneeinner(renderer, 80,1, (1,1,1)) #bone kneeinner(renderer, 79,1, (1,1,1)) #bone kneeinner(renderer, 78,1, (1,1,1)) #bone kneeinner(renderer, 77,1, (1,1,1)) #bone kneeinner(renderer, 76,1, (1,1,1)) #bone kneeinner(renderer, 75,1, (1,1,1)) #bone kneeinner(renderer, 74,1, (1,1,1)) #bone kneeinner(renderer, 140,1, (0,0,0)) #InnerBone kneeinner(renderer, 90,1, (1,1,1)) #InnerBone kneeinner(renderer, 20,0.2,(1, 0.8, 0.4)) #skin kneeinner(renderer, 60,0.05,(1, 0.25, 0.25)) #skin