| from paraview.simple import * |
|
|
| |
| ml100vtk = LegacyVTKReader(registrationName='ml-slice-iso.vtk', FileNames=['ml-slice-iso/data/ml-slice-iso.vtk']) |
|
|
| |
| slice1 = Slice(registrationName='Slice1', Input=ml100vtk) |
| slice1.SliceType = 'Plane' |
| slice1.HyperTreeGridSlicer = 'Plane' |
| slice1.SliceOffsetValues = [0.0] |
| slice1.PointMergeMethod = 'Uniform Binning' |
|
|
| |
| contour1 = Contour(registrationName='Contour1', Input=slice1) |
| contour1.ContourBy = ['POINTS', 'var0'] |
| contour1.Isosurfaces = [0.5] |
| contour1.PointMergeMethod = 'Uniform Binning' |
|
|
| |
| renderView = CreateView('RenderView') |
| renderView.ViewSize = [1920, 1080] |
|
|
| |
| layout = CreateLayout(name='Layout') |
| layout.AssignView(0, renderView) |
|
|
| |
| contour1Display = Show(contour1, renderView) |
| contour1Display.ColorArrayName = ['POINTS', ''] |
| contour1Display.DiffuseColor = [1.0, 0.0, 0.0] |
|
|
| |
| renderView.ResetActiveCameraToPositiveX() |
| renderView.ResetCamera() |
|
|
| |
| SaveScreenshot('ml-slice-iso/results/{agent_mode}/ml-slice-iso.png', renderView, ImageResolution=[1920, 1080], OverrideColorPalette='WhiteBackground' ) |
|
|
|
|