In addition to the standard RenderProps that control how the nodes and surfaces appear, finite element models and their subcomponents have a few additional properties that affect rendering. Some of these are listed in Table 6.6.
Property | Description |
---|---|
elementWidgetSize | size of element to render |
directionRenderLen | relative length to draw fibre direction indicator |
directionRenderType | where to draw directions: ELEMENT, INTEGRATION_POINT |
surfaceRendering | how to render surface: None, Shaded, Stress, Strain, MAPStress, MAPStrain, MaxShearStress, MaxShearStrain |
stressPlotRange | range of values for stress/strain plot |
stressPlotRanging | how to determine stress/strain plot range: Auto, Fixed |
colorMap | delegate object controlling the map of stress/strain values to color |
The property elementWidgetSize applies only to FemModel3d and FemElement3d. It specifies the scale to draw each element volume. For instance, the blue beam in Figure 7.2 uses a widget size of 0.8, resulting in a mosaic-like pattern.
The next two properties in Table 6.6 apply to the muscle classes FemMuscleModel, MuscleBundle, and MuscleElementDesc. When directionRenderLen > 0, lines are drawn inside elements to indicate fibre directions. If directionRenderType = ELEMENT, then one line is drawn per element indicating the average contraction direction. If directionRenderType = INTEGRATION_POINT, a separate direction line is drawn per point.
The last four properties apply to
FemModel3d and
FemMeshComp.
They control how the surface is colored. This can be used to enable stress/strain
visualizations. The property surfaceRendering sets what to draw:
None
no surface
Shaded
the face color specified by the mesh’s RenderProps
Stress
the von Mises stress
Strain
the von Mises strain
MAPStress
Maximum absolute value principal stress
MAPStrain
Maximum absolute value principal strain
MaxShearStress
Maximum shear stress
MaxStearStrain
Maximum sheer strain
The stressPlotRange controls the range of values to use when plotting
stress/strain. Values outside this range are truncated. The colorMap
is a delegate object that converts those stress and strain values to colors.
Various types of maps exist, including
GreyscaleColorMap,
HueColorMap,
RainbowColorMap, and
JetColorMap. These all implement the
ColorMap interface.
To display values corresponding to colors, a ColorBar needs to be added to the RootModel. Color bars are general Renderable objects that are only used for visualizations. They are added to the display using the
method in RootModel. Color bars also have a ColorMap associated with it. The following functions are useful for controlling its visualization:
The normalized location specifies sizes relative to the screen size (1 = screen width/height). The location override, if values are non-zero, will override the normalized location, specifying values in absolute pixels. Negative values for position correspond to distances from the left/top. For instance,
will create a bar that is 10% up from the bottom of the screen, 40 pixels from the right edge, with a height occupying 80% of the screen, and width 20 pixels.
Note that the color bar is not associated with any mesh or finite element model. Any synchronization of colors and labels must be done manually by the developer. It is recommended to do this in the RootModel’s prerender(...) method, so that colors are updated every time the model’s rendering configuration changes.
The following model extends FemBeam to render stress, with an added color bar. The loaded model is shown in Figure 6.22.