### Topological Mapping (2/7)

Description

In this step we load a tetrahedral mesh using a mesh file and dynamic topological components. For details concerning differences between static and dynamic topologies, refer to topological tutorials.

Key points

- A meshLoader to read mesh file. (not necessary in regular mesh)
- A mechanicalObject with geometry point positions.
- Dynamic topological components to store the volume mesh.

Add a new GNode to the root node. Rename it "Tetrahedrons Mesh".

Add a MeshGmshLoader component to the Tetrahedrons Mesh node. Rename it "loader". Specify the Filename of the object to be /Sofa/share/mesh/cylinder.msh.

Add a MechanicalObject component to the Tetrahedrons Mesh node. Rename it "Volume".

Under the Transformations tab, press the Scale of the DOFs in 3 dimensions button. In the textbox that appears, enter "@loader.scale3d". Similarly, press the Translation of the DOFs button and enter "@loader.translation", and press the Rotation of the DOFs button and enter "@loader.rotation".

Under the Vector 1/4 tab, press the position coordinates of the degrees of freedom button. In the textbox that appears, enter "@loader.position".

Add a TetrahedronSetTopologyContainer component to the Tetrahedrons Mesh node. Rename it "Container". Specify /Sofa/share/mesh/cylinder.msh as the Filename of the mesh. TetrahedronSetTopologyContainer is a topology container, it is used to store a topology (positions, edges, triangles, tetrahedrons). Usually this topology is not defined manually, but copied from the topology of a MeshLoader component.

In the Property 2/2 tab, press the List of tetrahedron indices button. Enter "@loader.tetrahedra" in the textbox that appears. This syntax means that the Data "tetrahedra" contained in the SOFA Component of this node named "loader" must be copied into this Data.

Add a TetrahedronSetGeometryAlgorithms component to the Tetrahedrons Mesh node. In the Visualization 2/2 tab, check the if true, draw the tetahedra in the topology box

Change the RGB code color used to draw tetrahedra property to (1 1 0.3).

The options in the TetrahedronSetGeometryAlgorithms component are used to display the topological element (tetrahedra here).

Results

Run in SOFA and animate.

In this scene we only have the tetrahedral mesh in terms of topology and geometry. No interactions are possible at this step.

### Previous ____________ Next