The aim of this tutorial is to show the different ways to create 2D surface mesh topologies. In this tutorial, three soft tissues are represented, implying:
- A mesh loader to read mesh file. (not necessary in regular mesh)
- A mechanicalObject with geometry point positions.
- A mass for gravity and fixed points.
- A FEM forcefield to create interaction between points
- An ODE scheme and a linear solver to solve the system at each time step.
- A topological component.
- A visual model which reproduces the current model geometry thanks to the identity mapping.
Key points
There are three possible ways to build a 2D surface mesh using the following components.
These components are extensions of the ones explained in the
Tutorial Topology Linear Different Mesh.
- MeshTopology creates a static mesh (red model). Here there are triangles and edges, using a mesh file. But no modifications are possible.
- RegularGridTopology creates a regular mesh (blue model). Here there are regular quads. No mesh file needed, using only boundaries and the scaling.
- TriangleSetTopologyContainer creates a dynamic mesh (green model). Here there are triangles and edges, using a mesh file. Other classes can be added to perform topological operations. Classes are TriangleSetTopologyModifier (for unitary operation), TriangleSetTopologyAlgorithms (for more complex topological operations) and TriangleSetGeometryAlgorithms (to couple topology algorithms and geometry positions).
Results
Thus, when simulated, the three models will fall due to gravity. A different behavior can be noticed for the regular grid near the fix points due to the different topology elements used (triangles versus quads).
Note that it is possible to add triangle behavior for the regular grid, using a topological mapping. See
TutorialTopologyQuad2TriangleTopologicalMapping.