@@ -6,13 +6,14 @@ Geometry Visualization
66
77.. currentmodule :: openmc
88
9- OpenMC is capable of producing two-dimensional slice plots of a geometry as well
10- as three-dimensional voxel plots using the geometry plotting :ref: `run mode
11- <usersguide_run_modes>`. The geometry plotting mode relies on the presence of a
12- :ref: `plots.xml <io_plots >` file that indicates what plots should be created. To
13- create this file, one needs to create one or more :class: `openmc.Plot `
14- instances, add them to a :class: `openmc.Plots ` collection, and then use the
15- :class: `Plots.export_to_xml ` method to write the ``plots.xml `` file.
9+ OpenMC is capable of producing two-dimensional slice plots of a geometry,
10+ three-dimensional voxel plots, and three-dimensional raytrace plots using the
11+ geometry plotting :ref: `run mode <usersguide_run_modes >`. The geometry plotting
12+ mode relies on the presence of a :ref: `plots.xml <io_plots >` file that indicates
13+ what plots should be created. To create this file, one needs to create one or
14+ more instances of the various plot classes described below, add them to a
15+ :class: `openmc.Plots ` collection, and then use the :class: `Plots.export_to_xml `
16+ method to write the ``plots.xml `` file.
1617
1718-----------
1819Slice Plots
@@ -21,15 +22,14 @@ Slice Plots
2122.. image :: ../_images/atr.png
2223 :width: 300px
2324
24- By default, when an instance of :class: `openmc.Plot ` is created, it indicates
25- that a 2D slice plot should be made. You can specify the origin of the plot
26- (:attr: `Plot.origin `), the width of the plot in each direction
27- (:attr: `Plot.width `), the number of pixels to use in each direction
28- (:attr: `Plot.pixels `), and the basis directions for the plot. For example, to
29- create a :math: `x` - :math: `z` plot centered at (5.0, 2.0, 3.0) with a width of
30- (50., 50.) and 400x400 pixels::
25+ The :class: `openmc.SlicePlot ` class indicates that a 2D slice plot should be
26+ made. You can specify the origin of the plot (:attr: `SlicePlot.origin `), the
27+ width of the plot in each direction (:attr: `SlicePlot.width `), the number of
28+ pixels to use in each direction (:attr: `SlicePlot.pixels `), and the basis
29+ directions for the plot. For example, to create a :math: `x` - :math: `z` plot
30+ centered at (5.0, 2.0, 3.0) with a width of (50., 50.) and 400x400 pixels::
3131
32- plot = openmc.Plot ()
32+ plot = openmc.SlicePlot ()
3333 plot.basis = 'xz'
3434 plot.origin = (5.0, 2.0, 3.0)
3535 plot.width = (50., 50.)
@@ -47,7 +47,7 @@ that location.
4747
4848By default, a unique color will be assigned to each cell in the geometry. If you
4949want your plot to be colored by material instead, change the
50- :attr: `Plot .color_by ` attribute::
50+ :attr: `SlicePlot .color_by ` attribute::
5151
5252 plot.color_by = 'material'
5353
@@ -68,8 +68,8 @@ particular cells/materials should be given colors of your choosing::
6868Note that colors can be given as RGB tuples or by a string indicating a valid
6969`SVG color <https://www.w3.org/TR/SVG11/types.html#ColorKeywords >`_.
7070
71- When you're done creating your :class: `openmc.Plot ` instances, you need to then
72- assign them to a :class: `openmc.Plots ` collection and export it to XML::
71+ When you're done creating your :class: `openmc.SlicePlot ` instances, you need to
72+ then assign them to a :class: `openmc.Plots ` collection and export it to XML::
7373
7474 plots = openmc.Plots([plot1, plot2, plot3])
7575 plots.export_to_xml()
@@ -97,13 +97,11 @@ Voxel Plots
9797.. image :: ../_images/3dba.png
9898 :width: 200px
9999
100- The :class: `openmc.Plot ` class can also be told to generate a 3D voxel plot
101- instead of a 2D slice plot. Simply change the :attr: `Plot.type ` attribute to
102- 'voxel'. In this case, the :attr: `Plot.width ` and :attr: `Plot.pixels ` attributes
103- should be three items long, e.g.::
100+ The :class: `openmc.VoxelPlot ` class enables the generation of a 3D voxel plot
101+ instead of a 2D slice plot. In this case, the :attr: `VoxelPlot.width ` and
102+ :attr: `VoxelPlot.pixels ` attributes should be three items long, e.g.::
104103
105- vox_plot = openmc.Plot()
106- vox_plot.type = 'voxel'
104+ vox_plot = openmc.VoxelPlot()
107105 vox_plot.width = (100., 100., 50.)
108106 vox_plot.pixels = (400, 400, 200)
109107
0 commit comments