Forum Replies Created
-
AuthorPosts
-
HugoKeymaster
Ola @eaparra
I guess you are looking to model a cantilever test, is it correct?
Could you share the full scene? It would help reading what is the size of the beam model.
I am not sure to understand why you are using the ArticulatedSystemMapping?Best,
Hugo
23 August 2021 at 19:14 in reply to: How to apply an orientation-dependent pure torque to Rigid body? #20216HugoKeymasterHey @jay-h
Very interesting topic, thanks for your message.
I am sorry to read that your investigation was painful. I am now here to make sure the pain vanish!1. With Rigid3d (rigid) objects, the degrees of freedom (dofs) in SOFA are :
– position with 7 dofs: [x, y, z] + quaternion (3 positions, 4 orientation)
– velocities with 6 dofs : [vx, vy, vz], [tx, ty, tz] (3 velocities, 3 torques)getVCenter() is a method which returns the velocity part [vx, vy, vz] of state vector. In the addForce function, the vector “fq” is the resulting force vector (accumulated in the b vector if our system looks like Ax=b) and “fq.getVCenter()” correponds to [fx, fy, fz].
2. Therefore, on the “fq” force vector, the function getVOrientation() returns the torques [tx, ty, tz].
3. Pos corresponds to the torque [tx, ty, tz] –>
typedef type::Vec<3,real> Pos;
, you should therefore be able to access it by writing :const Pos t = tau*m_u; t[0] = 47;
4. To get the quaternion of x[0], you can write
x[0].getOrientation()
if x is the position state vector.
If x corresponds to the velocity state or a force vector it should be written:x[0].getVOrientation()
(you would then recover the torque as above)4-2. To get the quaternion values separately, you can do q[0], q[1], q[2], q[3].
5. To apply pure torque, let’s take the example of the TorsionFF again, all you need is to ONLY define:
fq[id].getVOrientation() += ...
withfq[id].getVCenter() = 0;
. To do what you propose:fq[id].getVOrientation()[0] = 10; fq[id].getVOrientation()[1] = 5; fq[id].getVOrientation()[2] = 1;
in the source code? For example, if I want to apply pure torque and its vector is [10, 5, 1], how can I apply this torque?
6 – How to deal with addDForce: the addDForce function is indeed the derivative of the force function with regards to the degrees of freedom.
Looking at the doc of the EulerImplicit, addDForce computesIn the TorsionForceField, the matrix D is indeed the jacobian matrix.
To implement your addDForce the question is : what is the expression of the force with regards on the degrees of freedom. Since your force (torque) depends on the orientation you should implement addDForce. What is this relationship ?Best wishes,
Best wishes,
Hugo
PS: I must say that modeling magnets in SOFA is a topic of interest. It would be amazing to have you presenting part of your work at the SOFA Week 2021. I can already tell you that there would be an audience for this!
HugoKeymasterHey @arsalan
You can have a look the demo scene:
– https://github.com/sofa-framework/sofa/blob/master/examples/Demos/liver.scn
– or https://github.com/sofa-framework/sofa/blob/master/applications/plugins/Geomagic/scenes/Geomagic-RigidSkull.scnHowever, we do not provide 3D models of organs since these data usually come from patients and are subject to their approval for diffusion.
Could you tell us more about your simulation objectives? Surgical field targeted?
Best wishes,
Hugo
HugoKeymaster23 August 2021 at 18:32 in reply to: BilateralInteractionConstraint causes unrealistic motion #20211HugoKeymasterHi @asedal
Since we already chatted about it in private Audrey, I let you update the post whenever it’s the right time 😉
Best,
Hugo
HugoKeymasterOla @dacavas
To answer this, I think I will need the help of @epernod expert of topological changes and cuts from InfinyTech3D.
Best
Hugo
HugoKeymasterDear @syoy @chiarasapo
Thank you for reporting this issue.
It would be interesting to have a simple scene which reproduces it. Could you share a simple failing example?
This might be avoided by checking in all functions reading in m_ContactsVectorBuffer, that this vector is not empty. If so, returning an error. It would be nice @syoy if you could test and pull-request this.
Best,
Hugo
PS: note that a platform should be soon released on the use of SOFA + Gym. This should be presented officially at the SOFA Week 2021
HugoKeymasterDear @kevincollier,
Welcome on the SOFA forum!
Lasers are not actually model in the physics simulation for tumor ablation. We model the heat generated by the laser through experimental models.
Could you tell us more about your are expecting to model regarding the treatment of refractive errors in the eyes?Best wishes,
Hugo
23 August 2021 at 18:15 in reply to: How can I make my own actuators? And what are SOFA prefabs? #20207HugoKeymasterDear @daserk
Welcome on the SOFA forum and thank you for your interest in our open-source platform.
The SoftRobots plugin is indeed a plugin for soft-robotics developed by a research team for SOFA. This plugin is not part of the open-source core of SOFA but I am glad to answer your questions.
1. A prefab as defined in the STLIB plugin is a set of components used of the simulation. Instead of defining your self all components of the simulation, these “templates” create a set of components. E.g. for an elastic object, instead of defining your self the solvers, the material etc., a prefab can be used to automatically add the components required to simulate a deformable object.
2. Actuators are modeled in the SoftRobots plugin as constraints. These constraint laws are C++ classes as listed in this SoftRobots folder. Creating a new actuator would require to implemnent it in C++. I am not sure this would be feasible fully in python.
The purpose of the team working with the SoftRobots plugin is to allow people to model their own robot. I will therefore ask the team whether there is or not a solution for your actuation.
Could you tell us more about the type of actuation you would be interested in?
Best wishes,
Hugo
HugoKeymasterDear SOFA Forum,
First of all, the SOFA team hope that you all had a nice 2021 summer. We apologize for the recent spam attack and we hope it did not cause you too much inconvenience.
This fact only motivates us more for a migration to the GitHub Discussions platform. We will work on the migration in the next week and keep you posted regarding the migration process.
Best wishes,
The SOFA staff.
HugoKeymasterhi @toriwalnuss
You should write this translation field into the scene file itself, not after the simulation is loaded.
Do not hesitate to share your updated version of it.Best,
Hugo
HugoKeymasterhi @toriwalnuss
In your first question, the problem was that :
– your obj mesh was wayyyyy too much detailed (to many elements)
– your msh mesh seems to have some connectivity issuesNow regarding your second post, this means both meshes are generated in two different locations or with two different coordinate systems (obj file is not centered in 0,0,0). In SOFA, you can apply a translation on your loaded mesh using the data field
translation="tx ty tz"
where tx, ty and tz are your 3d translations.Looking at your obj mesh :
translation="-33.7 0 -24.9"
should be the correct one.Best wishes,
Hugo
HugoKeymasterLet me poke again @froy to see whether he comes up with an idea/alternative!
BestHugo
HugoKeymasterCiao @mariatirindelli
As many devs, @guillaumeparan is off for the next two weeks. He will get back to you asap. Wishing you a nice summer!
Hugo
HugoKeymasterThe new release v21.06 is out for a month now (sorry for the delay, I was away these last weeks). The binaries include the latest version of SOFA, STLIB and the SoftRobots plugin!
Your feedback would be most appreciated.
Best wishes,Hugo
HugoKeymasterHey @ma1991
Sorry for the delay of the reply, I was away due baby arrival!
Exactly, as Jean Nico said, latest VTK formats from Paraview are maybe not supported in SOFA. It would be a nice contribution btw!Jean Nicolas’ suggestion was to read the vtk mesh with meshio (as you are doing on your second line) but then to fill the SOFA topology data from the information loaded in meshio in python. Without trying to generate a vtu.
Do you see the difference ?
Anyway, glad it worked.Best wishes,
Hugo
HugoKeymasterHey @geofliu
I think your question is directly linked to this solved post.
It basically explains that your mesh might have some issues. Could you confirm this? What is the meshtool you used?
Best
Hugo
HugoKeymasterHi guys,
Problems of compatibility of the STLIB plugin with the last v20.12 relase were reported. We are actively working on it to deliver a nice and fresh v21.06 SOFA release and an updated version of the STLIB plugin (thanks to the Defrost team)!
Stay tuned,
BestHugo
HugoKeymasterHugoKeymasterHi @benjamin
Sorry for the delay of this reply, I am currently out of the office.
Since I am unsure about the reply (since it focuses about SoftRobots plugin) let me poke an expert, @olivier-goury!
@benjamin poke me again within a few days if you do not get your answer.Best,
Hugo
HugoKeymasterOla @juan
Sorry for the delay of this reply, I am currently out of the office.
Let me reply your points:1. Regarding the OscillatorConstraint, indeed, using iterative (=indirect) solvers does not require to go through the applyConstraint API. However, changing the nature of the linear solver is a change of your numerical settings.
CGLinearSolver is an iterative one, as the MinResLinearSolver.2. To get the right total mass, all you need to give as input of the UniformMass is
totalMass="0.17906"
3. the checkbox “real time” actually enforces the time step DT to be equal to the actual time required to compute one time step. I advise NOT to use it.
Best wishes,
Hugo
HugoKeymasterThanks a lot for sharing JuanJo!
Best
Hugo
HugoKeymasterHi @xiaochaosui
The link you are referring to is a previous work and the code is not active anymore.
You can join the Gitter discussion room dedicated to this topic.Note as well that a team is developing a Cosserat plugin (line mechanical model following the Cosserat beam theory). This plugin handles needle modeling and should handle needle insertion. It could be worth looking at it.
Hugo
HugoKeymasterNote as well that a team is developing a Cosserat plugin (line mechanical model following the Cosserat beam theory). This plugin handles needle modeling and should handle needle insertion. It could be worth looking at it.
We also set up a Gitter discussion room dedicated to this topic.
Best,
Hugo
-
AuthorPosts