Repository navigation
Topological changes : renumbering for tetra removal #3156
Answered
by
epernod
kleinanita
asked this question in
Develop in C++
|
Hi guys A short question maybe for @epernod : we are removing tetra using the topological changes API of SOFA. SOFA version : master thanks in advance |
Answered by
epernod
Jul 22, 2022
Replies: 1 comment 1 reply
|
Hi, thank you for your question, it makes me realized this is not described anywhere.. I need to update the doc. Removing tetra id 4 and 6 in the same call/event will be done like this:
So at the end you will have a vector of 8 tetra which would be (using initial ids): Let me know if it is clear enough. |
1 reply
Answer selected by
kleinanita
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
thank you for your question, it makes me realized this is not described anywhere.. I need to update the doc.
So to answer your question. Let say you have a 10 tetra in your topology:
Tetra ids: [0; 1; ...; 9]
Removing tetra id 4 and 6 in the same call/event will be done like this:
- swap last tetra (9) and 6
- pop_back last tetra (9)
- swap last tetra (8) and 4
- pop_back last tetra (8)
So at the end you will have a vector of 8 tetra which would be (using initial ids):
[0, 1, 2, 3, 8, 5, 9, 7]
Let me know if it is clear enough.