Create Two Dimensional Plots of Slices Through a Model
Simple driver application used to create plots from planar slices through a model.
Attention
The plotter is fully integrated in the Viewing and Archiving Model Configurations and Viewing and Archiving Assemblies applications, and it is not rarely necessary to create a standalone input script.
Typical Use Cases
Check assembly geometry.
Check model configuration geometry.
Produce plots for documentation purposes (also see the ).
Additional Input Parameters
In the following plotter denotes a geometry_plotter parameter set, created as follows:
import applications.geometry_plotter as app
plotter = app.parameters()
This application supports all the general parameters, as well as the following:
-
plotter.assembly
: component or filename
Specify target assembly or assembly archive name. If not specified the
app_param.model
will be used when producing the plots.
- plotter.z
Cut plane positions perpendicular to the \(xy\) plane. For each value specified here, a new cut plot will be created at \(z\) equal to that value.
- plotter.x
Cut plane positions perpendicular to the \(yz\) plane. For each value specified here, a new cut plot will be created at \(x\) equal to that value.
- plotter.y
Cut plane positions perpendicular to the \(xz\) plane. For each value specified here, a new cut plot will be created at \(y\) equal to that value.
- plotter.frame
Specify the size of the frame in the to which the plot will be restricted. Must be three length values, specifying the size of the frame in \(x\), \(y\), and \(z\) direction respectively. If not set, the bounding box of the entire
app_param.model
orplotter.assembly
will be used.
-
plotter.center
: point
Set the center of the view
plotter.frame
. Defaults the center of the bounding box of theapp_param.model
orplotter.assembly
.
Command Line Usage
This application supports the following command line flags:
- --config-file <str>
Targets
app_param.config_file
.
- --target-mode <str>
Targets
app_param.target_mode
. Also determines which plugin will be used if the built-in plotting fails.
- --frame <float float float>
The size of the frame which the plot should be restricted to. Three floats given the \(x\), \(y\) and \(z\) coordinate sizes in centimeter.
If not specified, the bounding box of the entire model will be used.
- --center <float float float>
Center position of the frame. Accepts three centimeter values,one for each coordinate. It defaults to \(0,0,0\) if not specified.
- --x <float ..>
List (one or more) of cut positions perpendicular to the \(x\)-axis. Values are assumed to be in centimeter. This will generate cuts perpendicular to the \(yz\) plane.
- --y <float ..>
List (one or more) of cut positions perpendicular to the \(y\)-axis. Values are assumed to be in centimeter. This will generate cuts perpendicular to the \(xz\) plane.
- --z <float ..>
List (one or more) of cut positions perpendicular to the \(z\)-axis. Values are assumed to be in centimeter. This will generate cuts perpendicular to the \(xy\) plane.
- --pixels <int>
Number of pixels per square centimeter. The higher this value, the higher the resolution of the generated plots.
execute
Generates the plot image(s). Supports the following options:
- --threads <int>
Targets
app_param.threads
. Specify how many threads the plotting routine, or target code will use.
- --executable <str>
Targets
app_param.executable
.
- --arguments <str>
Targets
app_param.arguments
.
- --use-sub-code
Force the use of --target_mode instead of the built-in plotter. See the note below.
Note
This application will by default first try to use the built-in plotter. For this to work,
the plotter.assembly
must have been archive with cell indexing active, that is, with the
--search-tree flag, or with mesh completion requested. When plotting a complete configuration, all
assemblies must have been archived with cell indexing.
If these conditions are not met, the plotter will resort to the target sub code. This behavior can be forced, by
adding --use-sub-code
.
Examples
The following illustrates how to use the plotter directly in the python interpreter.
>>> from core import *
>>> from applications.geometry_plotter import GeometryPlotter
>>> app = GeometryPlotter()
>>> app.parameters.assembly = '/full/path/to/my_assembly.asm'
>>> app.parameters.z = 0.0 * units.cm
>>> app.parameters.working_directory = '/full/path/to/where/images/should/be/saved'
>>> app.parameters.pixels = 100
>>> app.execute(threads=2)