Home › Forum › SOFA › Programming with SOFA › [SOLVED] Using two topologies in a scene
Tagged: 32_bits, SOFA_1503, Topology, Windows_10
- This topic has 4 replies, 2 voices, and was last updated 8 years, 6 months ago by dilthoms.
-
AuthorPosts
-
28 April 2016 at 18:37 #6643dilthomsBlocked
Hi All,
I have a triangular mesh and I apply SparseGridTopology on it so that I can deform it using HexahedronFEMForceField. However, I would also like to remove some of the triangles of the mesh for which I need the mesh to have triangle topology. Is it possible to use two such topologies for the same object in SOFA? How can I do deformations for a mesh using HexahedronFEM and also remove triangles in the mesh?
2 May 2016 at 12:44 #6655HugoKeymasterDear Thomas,
I think what you need to use in the first place is a mapping, e.g. a BarycentricMapping. The mapping will create a correspondance between your SparseGrid supporting the mechanical/computational aspects and the triangular mesh. I guess the triangular mesh is used for visualization. Here is an example of such a mapping:
<Node name="TorusFEM-Hexa"> <!-- Hexa mesh from a grid for mechanics --> <EulerImplicitSolver rayleighStiffness="0.01"/> <CGLinearSolver iterations="50" tolerance="1e-06" threshold="1e-06"/> <RegularGrid nx="6" ny="2" nz="5" xmin="-2.5" xmax="2.5" ymin="-0.5" ymax="0.5" zmin="-2" zmax="2" /> <MechanicalObject dx="2.5" dy="0" dz="0" rx="0" ry="0" rz="0" scale="1.0"/> <UniformMass totalmass="1"/> <HexahedronFEMForceField name="HFEM" youngModulus="2000" poissonRatio="0.2"/> <Node name="Visu"> <!-- Triangular mesh (obj) for visualization --> <OglModel name="Visual" fileMesh="mesh/torus.obj" color="yellow" dx="2.5" dy="0" dz="0" scale="1.0"/> <BarycentricMapping input="@.." output="@Visual"/> </Node> </Node>
This is an example with a grid for the mechanics and a triangular mesh for the visualization of a torus shape.
What do you mean exactly by “removing some of the triangles of the mesh for which I need the mesh to have triangle topology” ?
Why and what is the criterion to remove triangles from the triangular mesh ?Hope this helps.
Hugo
2 May 2016 at 14:19 #6658dilthomsBlockedHi Hugo,
Thanks a lot for your reply.The simulation that I want to do is to cut a triangular surface mesh, say the torus in the example, using a pair of scissors. For this, I plan to remove triangles using topologymodifier. I tried to use the TriangleFEMForceField and its variants but they were unstable with collisions. HexahedronFEMForceField with a grid topology worked perfectly and took care of the stability issues. Since I want to cut the torus based on collision with the pair of scissors, I would like to use the actual topology of the mesh and remove those triangles with which the scissors collide. I know it does not make much sense to have two topologies for the same object but I was wondering if there was some way to achieve what I wanted using SOFA.
2 May 2016 at 16:21 #6659HugoKeymasterHi Thomas,
There is a sense sometimes to use two topologies. But here the problem is the following.
You use a hexahedron-based topology for the collision since it appears to be more robust.
Did I understand the problem correctly?
But, you want a nice visualization and do the cutting on the triangular mesh.
Using hexa-topology implies that the cutting will be done on the hexa-collision mesh.What you want is :
scissors –> hexa collision –> cutting the triangular meshAt my best knowledge, this does not exist in SOFA. Therefore, you will have to implement a specific engine triggering the cut (on triangles) by listening to the contacts between scissors and hexa.
Hugo
5 May 2016 at 17:37 #6676dilthomsBlockedYes, you have described the problem correctly and thanks for the updates.
-
AuthorPosts
- You must be logged in to reply to this topic.