CAE

 

Organizing the Data

The post-processor component of a Finite Element Analysis application, along with many virtual prototyping/simulation applications, typically displays a 3D model that has color data mapped to it. This color data represents the 'solved' model (The original CAD model gets sent to a mesher, and then the 'mesh' version is 'solved' for one or more variables, such as heat, stress, fluid flow, electromagnetic field, deformation, etc...) A legend bar is also commonly displayed so the end-user can see the relationship between color and results. Here are some general guidelines to follow when organizing the scene-graph:

3D Model

  • The model should generally be designed with the 3D/MCAD scene-graph principles in mind. The HOOPS/3dGS 'shell' primitive would be used to represent your 3D objects (meshes).
  • When representing the edges/wires of your model/mesh, the implicit edges of the HOOPS 'shell' primitive may not be adequate for display purposes, since they are simply the edges bordering the 'faces' that defined the point connectivity. For example, the triangles in your mesh may need to be 'internally' tesselated into 4 triangles to get the correct color interpolation. If you simply turned on the shell edges in this case, you would see a lot more edges in the scene (you'd see three additional edges on each shell face), but perhaps the only edges you wish to see are those bordering the 'original' pre-tesselation triangles. In this case, you could turn off edge visibility, and insert dedicated polylines to represent the edges of interest.
  • The color data is mapped using the HOOPS/3dGS 'color interpolation' and 'color index interpolation' Rendering_Options. Refer to Section 6.3.7 of the HOOPS/3dGS Programming Guide for more detailed usage information.

Legend Bar

  • A separate top-level segment in the 'model' will store the scene-graph components that represent the legend bar.
  • The HC_Compute_Circumcuboid function is used to calculate scene extents, and then the camera is reset appropriately. (If you're using HOOPS/MVO, the HBaseView::FitWorld routine does this work for you.) However, we want to exclude the legend bar segment from the extents calculation. Exclusion of a segment is achieved by setting the 'exclude bounding' Heuristic. Refer to Section 3.2.8 of the HOOPS/3dGS Programming Guide for more information about calculating scene extents, and excluding segments from the extents calculation.
  • The legend-bar segment should have the 'depth range' Rendering_Option set in it, so that it is always drawn on top of the model. Refer to Section 6.1.4 of the HOOPS/3dGS Programming Guide for more information about overlaying geometry.
  • The segment should have a new orthographic camera set in it. This essentialy defines another viewport in the window, and prevents the legend bar from being affected by changes to the main camera that is viewing the 3D model.
  • The legend bar itself is represented by a HOOPS/3dGS 'shell' that has vertex colors indexing into a local HOOPS/3dGS colormap. We'll put this chart geometry (and any corresponding annotation text/lines) in a subsegment called 'chart'. The interpol.c program provides an example of how to define a legend bar.

The diagram below depicts how the scene graph might look:

 

The HOOPS/3dGS pseudo-code corresponding with the blue portions of the diagram is listed down below. This code actually corresponds with the scene-graph contained in the 'analysis.hsf' file located in your <hoops>/datasets/hsf/cae directory. (A screenshot of this HSF file is included at the beginning of this document) Visually explore it's scene graph in a dynamic fashion by loading it into the HOOPS 3D Part Viewer, and then opening the 'Segment Browser' dialog. Additionally, review the ASCII readable version of analysis.hsf (and thus the scene-graph), by saving the HSF file out to an HMF file and then loading it into a text editor.

// define the model
HC_Open_Segment("?Include Library");
HC_Open_Segment("Model_0");
HC_Open_Segment("driveshaft");
HC_Open_Segment("fea_facets");
HC_Open_Segment("Body_1");
// define the model using shells
// turn off the visibility of 'edges' (to hide the implicit 'shell' edges)
HC_Open_Segment("fea_edges");
// define the edges using polylines
// if the 'shell edges' are suitable, omit this segment, and display the 'shell' edges above, as desired
HC_Close_Segment(); // close "driveshaft"
HC_Open_Segment("legendbar");
HC_Set_Rendering_Options("depth range = (0,0)");
HC_Set_Camera(set a camera which can view the extents of the geometry denoting the color 'chart');
HC_Set_Heuristics("exclude bounding");
HC_Open_Segment("chart");
// insert text/lines to annotation the legend bar
HC_Close_Segment(); // close "chart"
HC_Close_Segment(); // close "legendbar"
HC_Close_Segment(); // close "Model_0"
HC_Close_Segment(); // close "?Include Library"
// include the model into the scene
HC_Open_Segment("?driver/opengl/window0");
HC_Open_Segment("Scene");
HC_Include_Segment("Model_0");