openmc.WireframeRayTracePlot

class openmc.WireframeRayTracePlot(plot_id=None, name='')[source]

Plots wireframes of geometry with volume rendered colors

Colors are defined in the same manner as the Plot class, but with the addition of a coloring parameter resembling a macroscopic cross section in units of inverse centimeters. The volume rendering technique is used to color regions of the model. An infinite cross section denotes a fully opaque region, and zero represents a transparent region which will expose the color of the regions behind it.

Changed in version 0.15.1: Renamed from ProjectionPlot to WireframeRayTracePlot

Parameters
  • plot_id (int) – Unique identifier for the plot

  • name (str) – Name of the plot

Variables
  • id (int) – Unique identifier

  • name (str) – Name of the plot

  • pixels (Iterable of int) – Number of pixels to use in each direction

  • filename (str) – Path to write the plot to

  • color_by ({'cell', 'material'}) – Indicate whether the plot should be colored by cell or by material

  • background (Iterable of int or str) – Color of the background

  • mask_components (Iterable of openmc.Cell or openmc.Material or int) – The cells or materials (or corresponding IDs) to mask

  • mask_background (Iterable of int or str) – Color to apply to all cells/materials listed in mask_components

  • show_overlaps (bool) – Indicate whether or not overlapping regions are shown

  • overlap_color (Iterable of int or str) – Color to apply to overlapping regions

  • colors (dict) – Dictionary indicating that certain cells/materials should be displayed with a particular color. The keys can be of type Cell, Material, or int (ID for a cell/material).

  • level (int) – Universe depth to plot at

  • horizontal_field_of_view (float) – Field of view horizontally, in units of degrees, defaults to 70.

  • camera_position (tuple or list of ndarray) – Position of the camera in 3D space. Defaults to (1, 0, 0).

  • look_at (tuple or list of ndarray) – The center of the camera’s image points to this place in 3D space. Set to (0, 0, 0) by default.

  • up (tuple or list of ndarray) – Which way is up for the camera. Must not be parallel to the line between look_at and camera_position. Set to (0, 0, 1) by default.

  • orthographic_width (float) – If set to a nonzero value, an orthographic projection is used. All rays traced from the orthographic pixel array travel in the same direction. The width of the starting array must be specified, unlike with the default perspective projection. The height of the array is deduced from the ratio of pixel dimensions for the image. Defaults to zero, i.e. using perspective projection.

  • wireframe_thickness (int) – Line thickness employed for drawing wireframes around cells or material regions. Can be set to zero for no wireframes at all. Defaults to one pixel.

  • wireframe_color (tuple of ints) – RGB color of the wireframe lines. Defaults to black.

  • wireframe_domains (iterable of either Material or Cells) – If provided, the wireframe is only drawn around these. If color_by is by material, it must be a list of materials, else cells.

  • xs (dict) – A mapping from cell/material IDs to floats. The floating point values are macroscopic cross sections influencing the volume rendering opacity of each geometric region. Zero corresponds to perfect transparency, and infinity equivalent to opaque. These must be set by the user, but default values can be obtained using the set_transparent() method.

classmethod from_xml_element(elem)[source]

Generate plot object from an XML element

Parameters

elem (lxml.etree._Element) – XML element

Returns

WireframeRayTracePlot object

Return type

openmc.WireframeRayTracePlot

set_transparent(geometry)[source]

Sets all volume rendering XS to zero for the model

Parameters

geometry (openmc.Geometry) – The geometry for which the plot is defined

to_xml_element()[source]

Return XML representation of the projection plot

Returns

element – XML element containing plot data

Return type

lxml.etree._Element