Exemplo n.º 1
0
    renderView1.EnableRayTracing = 1
    renderView1.BackEnd = 'OSPRay pathtracer'
    renderView1.AmbientSamples = 1
    renderView1.SamplesPerPixel = args.samples
    renderView1.OSPRayMaterialLibrary = materialLibrary1

if args.ambient and args.ray:
    light1 = CreateLight()
    light1.Coords = 'Ambient'
    light1.Intensity = 3
    renderView1.AdditionalLights = light1

if len(args.files) > 1:
    import paratools
    source_sm = LegacyVTKReader(
        FileNames=paratools.ReplaceFilename(args.files, "sm_{}.vtk"))
    sources_ft, timearrays = paratools.ApplyForceTime([source_sm])
    source_sm, = sources_ft
else:
    source_sm = LegacyVTKReader(FileNames=args.files)

surf = Calculator(Input=source_sm)
surf.ResultNormals = 1
surf.ResultArrayName = 'normals'
surf.Function = 'nn'
try:
    surf.AttributeType = 'Point Data'
except:
    pass

# Stretch boundaries to fill the view.
Exemplo n.º 2
0
parser = argparse.ArgumentParser(
    description="Pathtracer rendering of bubbles and boundaries.")
parser.add_argument('files', nargs='+', help="list of data files 'sm_*.vtk'")
parser.add_argument('--force',
                    action="store_true",
                    help="overwrite existing files")
parser.add_argument('--draft', action="store_true", help="less samples")
parser.add_argument('--resolution',
                    nargs=2,
                    type=int,
                    default=[1920, 1080],
                    help="image resolution")
args = parser.parse_args()

source_bcvtk = LegacyVTKReader(
    FileNames=paratools.ReplaceFilename(args.files[:1], "bc.vtk"))
source_sm = LegacyVTKReader(FileNames=args.files)
sources_ft, timearrays = paratools.ApplyForceTime([source_sm])
source_sm, = sources_ft

light1 = CreateLight()
light1.Intensity = 8.0
light1.Type = 'Positional'
light1.Position = [
    0.006431806423015062, 1.4778652489672959, 1.6991249052313981
]
light1.FocalPoint = [
    1.9781192660676643, -0.1963031716820185, -1.997106578269941
]
#light1.DiffuseColor = [0.95, 0.75, 0.95]
light1.DiffuseColor = [1, 1, 1]
Exemplo n.º 3
0
                    default='omm',
                    help="Name of scalar field for volume rendering")
parser.add_argument('--subset',
                    type=int,
                    nargs=3,
                    default=[1020, 512, 512],
                    help="Subset to extract")
parser.add_argument('--ray', action="store_true", help="raytracing")
parser.add_argument('--res',
                    type=int,
                    default=1920,
                    help="Image width in pixels")
args = parser.parse_args()

source_bcvtk = LegacyVTKReader(
    FileNames=paratools.ReplaceFilename(args.files[:1], "bc.vtk"))

sources_ft = []
timearrays = []

div = 8
viewsize = [1920, 1080]
viewsize = [
    int(s * args.res / viewsize[0] + div - 1) // div * div for s in viewsize
]
if args.field_name != 'omm':
    source_omz = XDMFReader(FileNames=args.files)
    source_omz.CellArrayStatus = [args.field_name]
    source_omz.GridStatus = ['Grid_10220']
    (source_omz, ), (timearray, ) = paratools.ApplyForceTime([source_omz])
    sources_ft.append(source_omz)
Exemplo n.º 4
0
parser.add_argument('--preset_omz',
                    action="store_true",
                    help="combines --omz --bubble_slice --white")
parser.add_argument('--res',
                    type=int,
                    default=2048,
                    help="pixels per unit length (channel width)")
args = parser.parse_args()

if args.preset_omz:
    args.omz = True
    args.bubble_slice = True
    args.white = True

source_bcvtk = LegacyVTKReader(
    FileNames=paratools.ReplaceFilename(args.files[:1], "bc.vtk"))
source_sm = LegacyVTKReader(FileNames=args.files)
sources_ft, timearrays = paratools.ApplyForceTime([source_sm])
source_sm, = sources_ft

if args.omz:
    files_omz = paratools.ReplaceFilename(args.files, "omz_{}.xmf")
    source_omz = XDMFReader(FileNames=files_omz)
    source_omz.CellArrayStatus = ['omz']
    source_omz.GridStatus = ['Grid_10220']
    (source_omz, ), (timearray, ) = paratools.ApplyForceTime([source_omz])
    sources_ft.append(source_omz)
    timearrays.append(timearray)

box = paratools.GetBoundingBox(source_bcvtk)
boxc = (box[0] + box[1]) * 0.5