Home › Forum › SOFA › Using SOFA › [SOLVED] BoxROI doUpdate
- This topic has 5 replies, 3 voices, and was last updated 9 years, 2 months ago by Jeremie Allard.
-
AuthorPosts
-
15 August 2015 at 11:29 #3474sarramiBlocked
Hello
I have a question about the new properties of BoxROI (doUpdate). What does it do?
If it updates the elements in ROI does it work properly? Because when I test it in the example of SubsetTopologyMapping2 (with a little change), I don’t see any difference when the elements in the ROI change.
Regards
Sarrami20 August 2015 at 09:56 #3479HugoKeymasterDear Sarrami,
Indeed this option should update at each step the points and elements within the ROI.
Which example are you talking about ?
Is it your own scene ?Cheers,
Hugo
20 August 2015 at 11:37 #3483sarramiBlockedMr Talbot
Thanks for the reply.
In the attached example, which is present in SOFA source, I have activated the “do update” option in the BoxROI component in the child node which leads to an error.
I assume that if this component was working properly, the number of child elements in mesh (and colors of them) would change while playing with the sphere.Example attached in this link:
https://onedrive.live.com/redir?resid=F8B3C92B29C4B9E4!578&authkey=!AIjg2fKNc57x5Ck&ithint=file%2czip20 August 2015 at 12:12 #3484HugoKeymasterHi Sarrami,
The BoxROI is working fine, but your scene is not written correctly: the BoxROI must have a link with the MechanicalObject (and not the loader)
< boxroi template="Vec3d" name="subsetROI" box="-55 -55 25 55 55 55" position="@../dofs.position" triangles="@../Container1.triangles" computeEdges="0" computeTetrahedra="0" indices="0" drawBoxes="1" doUpdate="1" drawPoints="1" >
< trianglesettopologycontainer name="Container2" triangles="@subsetROI.trianglesInROI" >
< trianglesetgeometryalgorithms template="Vec3d" name="GeomAlgo" >Since the data of the loader are defined only ONCE while loading the mesh at the initialization.
Moreover, the scene is crashing. This is also due to the fact that the FEM Forcefield needs to be implemented to support dynamic topology. Apparently, this is not the case for both TriangularFEMForceFieldOptim and FastTriangularBendingSprings.
See the scene: http://we.tl/gnhQkRdsM6
Cheers,
Hugo
23 August 2015 at 07:56 #3491sarramiBlockedDear Talbot
Thank you for your points.
The scene that you sent wouldnt load anything unless I remove “TTiangleModel”!
I changed this:
<TriangleSetTopologyContainer name=”Container2″ triangles=”@subsetROI.trianglesInROI” />
to this:
<TriangleSetTopologyContainer name=”Container2″ position=”@../dofs.position” triangles=”@subsetROI.trianglesInROI” />I have tested and attached the my own scene with corrections that you mention but still the number of elements which is subjected to collision model of child node wouldn’t change when necessary. (in contrast to BOXROI visualization which is dynamic and adaptable). More than that, trying to remove an element would result in point index disorder. (look at the attached pictures.)
I want to apply an independent and adaptable component (forcefield or collision) on the elements contained in a ROI.pretty much like what VaccumeSphereForcefield does : applying a forcefield on “recent” elements contained inside a “movable” space.
Another method that I have tried, which is very close to my idea, is to completely detach the mesh inside ROI and pass it to child node like the example file “SubsetTopolgy” in the source. But it looks that SubsetTopolgy relies only on rest position of elements (i.e. works onetime).
Would you please share a simple example showing the performance of “do-update”?
attached files:
https://onedrive.live.com/redir?resid=F8B3C92B29C4B9E4!579&authkey=!AOv-uSElppF1NnA&ithint=file%2czipThanks.
26 August 2015 at 12:54 #3493Jeremie AllardBlockedHello,
TriangularFEMForceFieldOptim and FastTriangularBendingSprings do support dynamic topologies, however the topological changes must be sent in the proper way (trough the TopologyModifier component or using a topological mapping). Using a component like BoxROI to create a dynamically changing subset of a topology and linking it directly to the TopologyContainer triangles Data is not valid. It will partially work for some components but not all of them (and quite a few important things can go wrong, like the list of edges of the topology that will not be correctly updated).
The cleanest way to do what you are trying is to code a new component “DynamicSubsetTopologyMapping” that unlike SubsetTopologyMapping do not consider the requested subset as static but detect changes to it (triangles added or removed since the last time step) and infers the required topological change events such that all components can take the new topology into account.
A much simpler but dirty way would be to add an optional triangleIndices vector Data in the forcefield(s) you want to use and let them loop on this subset instead of the full topology.I hope this helps,
Jeremie.
-
AuthorPosts
- You must be logged in to reply to this topic.