1###############################################################################
2# Copyright (c) Lawrence Livermore National Security, LLC and other Ascent
3# Project developers. See top-level LICENSE AND COPYRIGHT files for dates and
4# other details. No copyright assignment is required to contribute to Ascent.
5###############################################################################
6
7
8import conduit
9import conduit.blueprint
10import ascent
11import numpy as np
12
13from ascent_tutorial_py_utils import tutorial_tets_example
14
15mesh = conduit.Node()
16# (call helper to create example tet mesh as in blueprint example 2)
17tutorial_tets_example(mesh)
18
19# Use Ascent to render with views with different camera parameters
20a = ascent.Ascent()
21a.open()
22a.publish(mesh)
23
24# setup actions
25actions = conduit.Node()
26add_act = actions.append()
27add_act["action"] = "add_scenes"
28
29# declare a scene to render the dataset
30scenes = add_act["scenes"]
31# add a pseudocolor plot (`p1`)
32scenes["s1/plots/p1/type"] = "pseudocolor"
33scenes["s1/plots/p1/field"] = "var1"
34# add a mesh plot (`p1`)
35# (experiment with commenting this out)
36scenes["s1/plots/p2/type"] = "mesh"
37scenes["s1/image_name"] = "out_scene_ex2_render_two_plots"
38
39# print our full actions tree
40print(actions.to_yaml())
41
42# execute the actions
43a.execute(actions)
44
45a.close()
46
47