Plot 3D blocks from Vorpal .in file (now with .stl files)

Following on from the last vorpal plotter I’ve updated things a bit. Instead of plotting everything in grid coordinates I’ve added a parser and appropriate conversion functions to plot everything in meters.

[scale, distanceOrigin, cellBounds, distanceBounds] = coords.getScales(file);

Where scale is the distance per cell; distanceOrigin is the position of grid position [0 0 0]; cellBounds is the boundary in cells; distance bounds is the same in meters.

Plot of pmlSlab.pre

This is a direct plot of Plot of using vorpal plotter.

You can select which blocks are plotted by entering them in the plot list. The scripts output all the blocks available for plotting to the console. You can specify them by name or type.

plotList = {'Region' 'FieldUpdater','BoundaryCondition'};

I’ve also added functions to plot and .stl file which you may have included in your .pre file. At the moment it does not parse this information from the .in file. You must import it yourself using code like this:

%get the information needed to plot an stl in the right place
translation = stl.getSTLTranslation(file);
%plot the stl named here (it does not parse it from the in file)
stl.plotstl('$YOUR_STL$.stl', 0.001, translation)

If you have mutliple .stl files imported then you need to make sure that the translation matrix is correct. The .stl should be plotted in the same place that vorpal interprets it to be. I’ve used code taken from to parse the .stl file.

I recomend you use the camera toolbar to inspect the plots rather than matlabs rotate tool. Although when using the rotate tool right clicking gives access to 2d face plots.

Camera toolbar

Use the camera tool bar, it works better than the rotate tool.

The source code and an example is here: Vorpal Plotter 0.21

I am yet to work out how to plot geometries specified using Heavisides, it might be a step to far for this technique.

Leave a Reply