# state file generated using paraview version 5.10.0-RC1-346-gee5cb7a444 # uncomment the following three lines to ensure this script works in future versions #import paraview #paraview.compatibility.major = 5 #paraview.compatibility.minor = 10 #### import the simple module from the paraview from paraview.simple import * #### disable automatic camera reset on 'Show' paraview.simple._DisableFirstRenderCameraReset() # ---------------------------------------------------------------- # setup views used in the visualization # ---------------------------------------------------------------- # get the material library materialLibrary1 = GetMaterialLibrary() # Create a new 'Render View' renderView1 = CreateView('RenderView') renderView1.ViewSize = [1488, 827] renderView1.AxesGrid = 'GridAxes3DActor' renderView1.CenterOfRotation = [2.9802322387695312e-08, 2.9802322387695312e-08, 1.4901161193847656e-08] renderView1.StereoType = 'Crystal Eyes' renderView1.CameraPosition = [-0.8767488560272855, 1.4939181408192024, 1.8966926667481134] renderView1.CameraFocalPoint = [2.9802322387695312e-08, 2.9802322387695312e-08, 1.4901161193847656e-08] renderView1.CameraViewUp = [0.32160035069616094, 0.8104299232082925, -0.489669841832951] renderView1.CameraFocalDisk = 1.0 renderView1.CameraParallelScale = 0.6648135312471619 renderView1.BackEnd = 'OSPRay raycaster' renderView1.OSPRayMaterialLibrary = materialLibrary1 SetActiveView(None) # ---------------------------------------------------------------- # setup view layouts # ---------------------------------------------------------------- # create new layout object 'Layout #1' layout1 = CreateLayout(name='Layout #1') layout1.AssignView(0, renderView1) layout1.SetSize(1488, 827) # ---------------------------------------------------------------- # restore active view SetActiveView(renderView1) # ---------------------------------------------------------------- # ---------------------------------------------------------------- # setup the data processing pipelines # ---------------------------------------------------------------- # create a new 'Sphere' sphere1 = Sphere(registrationName='Sphere1') # create a new 'Elevation' elevation1 = Elevation(registrationName='Elevation1', Input=sphere1) elevation1.LowPoint = [-0.48746395111083984, -0.48746395111083984, -0.5] elevation1.HighPoint = [0.48746395111083984, 0.48746395111083984, 0.5] # create a new 'Contour' contour1 = Contour(registrationName='Contour1', Input=elevation1) # NOTE uncommenting this fixes the issue # contour1.ContourBy = ['POINTS', 'None'] contour1.ContourBy = ['POINTS', 'Elevation'] contour1.Isosurfaces = [0.5000000149011612] contour1.PointMergeMethod = 'Uniform Binning' # ---------------------------------------------------------------- # setup the visualization in view 'renderView1' # ---------------------------------------------------------------- # show data from contour1 contour1Display = Show(contour1, renderView1, 'GeometryRepresentation') # get color transfer function/color map for 'Elevation' elevationLUT = GetColorTransferFunction('Elevation') elevationLUT.RGBPoints = [0.3925376534461975, 0.231373, 0.298039, 0.752941, 0.5928961336612701, 0.865003, 0.865003, 0.865003, 0.7932546138763428, 0.705882, 0.0156863, 0.14902] elevationLUT.ScalarRangeInitialized = 1.0 # trace defaults for the display properties. contour1Display.Representation = 'Surface' contour1Display.ColorArrayName = ['POINTS', 'Elevation'] contour1Display.LookupTable = elevationLUT contour1Display.SelectTCoordArray = 'None' contour1Display.SelectNormalArray = 'Normals' contour1Display.SelectTangentArray = 'None' contour1Display.OSPRayScaleArray = 'Elevation' contour1Display.OSPRayScaleFunction = 'PiecewiseFunction' contour1Display.SelectOrientationVectors = 'None' contour1Display.ScaleFactor = 0.07900273501873017 contour1Display.SelectScaleArray = 'Elevation' contour1Display.GlyphType = 'Arrow' contour1Display.GlyphTableIndexArray = 'Elevation' contour1Display.GaussianRadius = 0.003950136750936508 contour1Display.SetScaleArray = ['POINTS', 'Elevation'] contour1Display.ScaleTransferFunction = 'PiecewiseFunction' contour1Display.OpacityArray = ['POINTS', 'Elevation'] contour1Display.OpacityTransferFunction = 'PiecewiseFunction' contour1Display.DataAxesGrid = 'GridAxesRepresentation' contour1Display.PolarAxes = 'PolarAxesRepresentation' # init the 'PiecewiseFunction' selected for 'ScaleTransferFunction' contour1Display.ScaleTransferFunction.Points = [0.5, 0.0, 0.5, 0.0, 0.5001220703125, 1.0, 0.5, 0.0] # init the 'PiecewiseFunction' selected for 'OpacityTransferFunction' contour1Display.OpacityTransferFunction.Points = [0.5, 0.0, 0.5, 0.0, 0.5001220703125, 1.0, 0.5, 0.0] # setup the color legend parameters for each legend in this view # get color legend/bar for elevationLUT in view renderView1 elevationLUTColorBar = GetScalarBar(elevationLUT, renderView1) elevationLUTColorBar.Title = 'Elevation' elevationLUTColorBar.ComponentTitle = '' # set color bar visibility elevationLUTColorBar.Visibility = 1 # show color legend contour1Display.SetScalarBarVisibility(renderView1, True) # ---------------------------------------------------------------- # setup color maps and opacity mapes used in the visualization # note: the Get..() functions create a new object, if needed # ---------------------------------------------------------------- # get opacity transfer function/opacity map for 'Elevation' elevationPWF = GetOpacityTransferFunction('Elevation') elevationPWF.Points = [0.3925376534461975, 0.0, 0.5, 0.0, 0.7932546138763428, 1.0, 0.5, 0.0] elevationPWF.ScalarRangeInitialized = 1 # ---------------------------------------------------------------- # restore active source SetActiveSource(contour1) # ---------------------------------------------------------------- if __name__ == '__main__': # generate extracts SaveExtracts(ExtractsOutputDirectory='extracts')