Home › Forum › SOFA › Programming with SOFA › [SOLVED] How to break the spring between mesh?
Tagged: TopologicalChange
- This topic has 11 replies, 5 voices, and was last updated 7 years, 11 months ago by Hugo.
-
AuthorPosts
-
1 February 2016 at 13:07 #5482AlisonBlocked
Dear all,
Is there a way to break individual spring in meshSpring force field? I want to break it and remesh the model when the stress inside the spring is more then a specific value.
Thanks in advance.4 February 2016 at 10:49 #5530HugoKeymasterHi Alison,
This is a very challenging project that you have here! Simulating deformable object is ok, with dynamic breaking of springs ok, but then do dynamic remeshing from the computation of the stress. It starts growing in term of complexity!
About how to break individual springs, you would need to create a component inheriting from meshSpringFF where you implement a function “removeSpring” doing the opposite than addSpring function (line 50 in meshSpringForceField.inl). You could then call this function when a specific event occurs.
We are currently working on dynamic remeshing based on VM stress as well. But this is really a on-going work. But I am no expert on the remeshing subject. @hpbui may be able to help ?
Cheers,
Hugo
5 February 2016 at 09:01 #5547Huu Phuoc BUIBlockedDear Alison,
If the topology of springs is within a ” topology container” like EdgeSetTopologyContainer for example, in order to break springs when their stress/strain exceed a threshold, you can simply use the removeEdges from EdgeSetTopologyModifier. Just after removal of the edge from your topology, you should propagate the change of the topology (by calling propagateTopologicalChanges() ) so that this change is taken into account in your force fields.
Hope these help.
Cheers,
Phuoc6 February 2016 at 02:49 #5600WengBlockedDear Alison,
Dynamic topological change involves most parts of simulation. I am not an expert, here is what I think:
(1) First check if your forcefield support dynamic topological change. Is there a function “handleTopologicalChange” ? If not, you need to implement it.
(2) Need to call functions (e.g. removeTriangles, addTriangles…) in Modifier (e.g. TriangleSetTopologyModifier). These functions will call all handleTopologicalChange going down your scene graph. It will also change the mechanical state of your MechanicalObject.
(3) Some components did not handleTopologicalChange well by now, you need to check or modify them. For examples, adding points in OglModel troubles me a lot.regards,
Weng Bin28 April 2016 at 16:53 #6642jennyBlockedDear Alison,
I have met the same problem.
would you please share your solution?
Thanks a lot!2 May 2016 at 10:51 #6648HugoKeymasterDear Jenny,
Did you read the comments of both Phuoc & Weng, just above.
I think they might be very useful to implement what you want.In case, you face any other problem, do no hesitate to describe it more specifically here (if the topics corresponds) or in a new topic!
Cheers,
Hugo
6 June 2016 at 14:44 #7029HugoKeymaster6 June 2016 at 15:23 #7046jennyBlockedDear Hugo,
I have not tried yet.Thanks for your kindness help!
Best wishes,
Jenny6 June 2016 at 15:36 #7051HugoKeymasterDear Jenny,
We are letting this thread open for you, so that you can post any future question.
If you have any other question (unrelated to this topic), do not hesitate to create a new thread.
Best regards,Hugo
7 June 2016 at 10:52 #7070AlisonBlockedDear Hugo and Jenny,
I’ve read the comments and found it kind of difficult for me to implement now, so I haven’t tried it either.
Thanks for your help! I will tell you as long as I solve it.7 June 2016 at 11:11 #7071HugoKeymasterDear Alison & Jenny,
For topological changes, there is relatively easy way of dealing with it in SOFA. All you need is:
- a topology with a Container (e.g. EdgeSetTopologyContainer if you work with edges),
- and a topological modifier (e.g. EdgeSetTopologyModifier with edges).
Thus, you will be able to call the functions of the modifier to change the topology as you want.
There is unfortunately few examples in the public version of SOFA. In the code of the component VectorSpringForceField.inl (in modules/SofaDeformable/ at line 273) you have an example of edge removal. And the scene examples/Demos/TriangleSurfaceCutting.scn is a good example of topological changes (with right click and wheel click).
Hope this helps.
Best regards,Hugo
20 December 2016 at 14:28 #8231 -
AuthorPosts
- You must be logged in to reply to this topic.