@@ -126,27 +126,29 @@ will depend on the 3D viewer, but should be straightforward.
126126Projection Plots
127127----------------
128128
129- .. image :: ../_images/hexlat_anim.gif
130- :width: 200px
131-
132- The :class: `openmc.ProjectionPlot ` class presents an alternative method
133- of producing 3D visualizations of OpenMC geometries. It was developed to
134- overcome the primary shortcoming of voxel plots, that an enormous number
135- of voxels must be employed to capture detailed geometric features.
136- Projection plots perform volume rendering on material or
137- cell volumes, with colors specified in the same manner as slice plots.
138- This is done using the native ray tracing capabilities within OpenMC,
139- so any geometry in which particles successfully run without overlaps
140- or leaks will work with projection plots.
141-
142- One drawback of projection plots is that particle tracks cannot be overlaid
143- on them at present. Moreover, checking for overlap regions is not currently possible with projection plots. The image heading this section can
144- be created by adding the following code to the hexagonal lattice example packaged
145- with OpenMC, before exporting to plots.xml.
129+ .. only :: html
130+
131+ .. image :: ../_images/hexlat_anim.gif
132+ :width: 200px
133+
134+ The :class: `openmc.ProjectionPlot ` class presents an alternative method of
135+ producing 3D visualizations of OpenMC geometries. It was developed to overcome
136+ the primary shortcoming of voxel plots, that an enormous number of voxels must
137+ be employed to capture detailed geometric features. Projection plots perform
138+ volume rendering on material or cell volumes, with colors specified in the same
139+ manner as slice plots. This is done using the native ray tracing capabilities
140+ within OpenMC, so any geometry in which particles successfully run without
141+ overlaps or leaks will work with projection plots.
142+
143+ One drawback of projection plots is that particle tracks cannot be overlaid on
144+ them at present. Moreover, checking for overlap regions is not currently
145+ possible with projection plots. The image heading this section can be created by
146+ adding the following code to the hexagonal lattice example packaged with OpenMC,
147+ before exporting to plots.xml.
146148
147149::
148150
149- r = 5
151+ r = 5
150152 import numpy as np
151153 for i in range(100):
152154 phi = 2 * np.pi * i/100
@@ -162,48 +164,46 @@ with OpenMC, before exporting to plots.xml.
162164 thisp.xs[iron] = 1.0
163165 thisp.wireframe_domains = [fuel]
164166 thisp.wireframe_thickness = 2
165-
167+
166168 plot_file.append(thisp)
167169
168- This generates a sequence of png files which can be joined to form a gif.
169- Each image specifies a different camera position using some simple periodic
170- functions to create a perfectly looped gif. :attr: `ProjectionPlot.look_at `
171- defines where the camera's centerline should point at.
172- :attr: `ProjectionPlot.camera_position ` similarly defines where the camera
173- is situated in the universe level we seek to plot. The other settings
174- resemble those employed by :class: `openmc.Plot `, with the exception of
175- the :class: `ProjectionPlot.set_transparent ` method and :attr: `ProjectionPlot.xs `
176- dictionary. These are used to control volume rendering of material
177- volumes. "xs" here stands for cross section, and it defines material
178- opacities in units of inverse centimeters. Setting this value to a
179- large number would make a material or cell opaque, and setting it to
180- zero makes a material transparent. Thus, the :class: `ProjectionPlot.set_transparent `
181- can be used to make all materials in the geometry transparent. From there,
182- individual material or cell opacities can be tuned to produce the
183- desired result.
184-
185- Two camera projections are available when using these plots, perspective
186- and orthographic. The default, perspective projection,
187- is a cone of rays passing through each pixel which radiate from the camera
188- position and span the field of view in the x and y positions. The horizontal
189- field of view can be set with the :attr: `ProjectionPlot.horizontal_field_of_view ` attribute,
190- which is to be specified in units of degrees. The field of view only influences
191- behavior in perspective projection mode.
170+ This generates a sequence of png files which can be joined to form a gif. Each
171+ image specifies a different camera position using some simple periodic functions
172+ to create a perfectly looped gif. :attr: `ProjectionPlot.look_at ` defines where
173+ the camera's centerline should point at. :attr: `ProjectionPlot.camera_position `
174+ similarly defines where the camera is situated in the universe level we seek to
175+ plot. The other settings resemble those employed by :class: `openmc.Plot `, with
176+ the exception of the :class: `ProjectionPlot.set_transparent ` method and
177+ :attr: `ProjectionPlot.xs ` dictionary. These are used to control volume rendering
178+ of material volumes. "xs" here stands for cross section, and it defines material
179+ opacities in units of inverse centimeters. Setting this value to a large number
180+ would make a material or cell opaque, and setting it to zero makes a material
181+ transparent. Thus, the :class: `ProjectionPlot.set_transparent ` can be used to
182+ make all materials in the geometry transparent. From there, individual material
183+ or cell opacities can be tuned to produce the desired result.
184+
185+ Two camera projections are available when using these plots, perspective and
186+ orthographic. The default, perspective projection, is a cone of rays passing
187+ through each pixel which radiate from the camera position and span the field of
188+ view in the x and y positions. The horizontal field of view can be set with the
189+ :attr: `ProjectionPlot.horizontal_field_of_view ` attribute, which is to be
190+ specified in units of degrees. The field of view only influences behavior in
191+ perspective projection mode.
192192
193193In the orthographic projection, rays follow the same angle but originate from
194- different points. The horizontal width of this plane of ray starting points
195- may be set with the :attr: `ProjectionPlot.orthographic_width ` element. If this element
196- is nonzero, the orthographic projection is employed. Left to its default value
197- of zero, the perspective projection is employed.
198-
199- Lastly, projection plots come packaged with wireframe generation that
200- can target either all surface/cell/material boundaries in the geometry,
201- or only wireframing around specific regions. In the above example, we
202- have set only the fuel region from the hexagonal lattice example to have
203- a wireframe drawn around it. This is accomplished by setting the
204- :attr: ` ProjectionPlot.wireframe_domains `, which may be set to either material
205- IDs or cell IDs. The :attr: `ProjectionPlot.wireframe_thickness `
206- attribute sets the wireframe thickness in units of pixels.
194+ different points. The horizontal width of this plane of ray starting points may
195+ be set with the :attr: `ProjectionPlot.orthographic_width ` element. If this
196+ element is nonzero, the orthographic projection is employed. Left to its default
197+ value of zero, the perspective projection is employed.
198+
199+ Lastly, projection plots come packaged with wireframe generation that can target
200+ either all surface/cell/material boundaries in the geometry, or only wireframing
201+ around specific regions. In the above example, we have set only the fuel region
202+ from the hexagonal lattice example to have a wireframe drawn around it. This is
203+ accomplished by setting the :attr: ` ProjectionPlot.wireframe_domains `, which may
204+ be set to either material IDs or cell IDs. The
205+ :attr: `ProjectionPlot.wireframe_thickness ` attribute sets the wireframe
206+ thickness in units of pixels.
207207
208208.. note :: When setting specific material or cell regions to have wireframes
209209 drawn around them, the plot must be colored by materials if wireframing
0 commit comments