Hi,
I really like the new SolidRayTracePlot feature.
I cannot get it running, though:
The ‘simple’ example below gives me only an empty (white) image
Anything obvious I have overlooked?
Thanks in advance,
Richard
import openmc
# Define a material
mat = openmc.Material()
mat.set_density('g/cm3', 1.0)
mat.add_nuclide('H1', 2.0)
mat.add_nuclide('O16', 1.0)
materials = openmc.Materials([mat])
materials.export_to_xml()
# Create a sphere surface
sphere = openmc.Sphere(r=10.0, boundary_type='vacuum')
# Define a cell inside the sphere
cell = openmc.Cell()
cell.region = -sphere # Inside the sphere
cell.fill = mat
# Create a universe and geometry
universe = openmc.Universe(cells=[cell])
geometry = openmc.Geometry(universe)
# Export the geometry to XML
geometry.export_to_xml()
# Define a SolidRayTracePlot (corrected)
plot = openmc.SolidRayTracePlot()
plot.filename = "raytrace_plot" # Output file name
plot.width = (40.0, 40.0) # Size of the plot in cm
plot.pixels = (400, 400) # Image resolution
#plot.basis = 'xy' # Plane of the plot
plot.camera_position = (10.0, 20.0, -30.0)
plot.look_at = (4.0, 5.0, 1.0)
# Export plot settings to XML
plots = openmc.Plots([plot])
plots.export_to_xml()
#
openmc.plot_geometry()
img = openmc.plot_inline(plots)