armi.bookkeeping.visualization.utils module
Utility classes/functions for visualization.
Most of these are derived from the VTK format, which tends to be general enough to support other formats. Most of the work goes into figuring out where the vertices should be for a given block/assembly shape. If this coupling becomes problematic, abstractions for primitive shapes should be created.
- class armi.bookkeeping.visualization.utils.VtkMesh(vertices, connectivity, offsets, cellTypes)[source]
Bases:
object
Container for VTK unstructured mesh data.
This provides a container for the necessary data to describe a mesh to VTK (vertex locations, connectivity, offsets, cell types). It supports appending one set of mesh data onto another, handling the necessary index offsets.
While the specifics are somewhat specific to the VTK format, the concept of storing a bunch of vertices and their connectivity is a relatively general one, so this may be of use to other formats as well.
- Parameters:
vertices (np.ndarray) – An Nx3 numpy array with one row per (x,y,z) vertex
connectivity (np.ndarray) – A 1-D array containing the vertex indices belonging to each cell
offsets (np.ndarray) – A 1-D array containing the index of the first vertex for the next cell
cellTypes (np.ndarray) – A 1-D array contining the cell type ID for each cell
- property x
- property y
- property z