Forum Replies Created
-
AuthorPosts
-
HugoKeymaster
Hey @noura
You are very welcome!
Note that the compliance for you information corresponds to the inverse of the A matrix of your Ax=b system.
Moreover, regarding the constraint, and the thread you were mentioning, that I will very soon make some update in the doc. You feedback about this upcoming update would be most welcome.Best
Hugo
HugoKeymasterThank you so much JN for this!
Thumbs up!HugoKeymasterHi Harris,
Is this c++ code somewhere in one of your own plugins?
If yes, did you check in the CMakeLists.txt of this plugin that it correctly depends on the Geomagic plugin?Hugo
HugoKeymasterHi Harris
instead of your first line:
sofa::component::controller::GeomagicDriver::SPtr geomDriver= sofa::core::objectmodel::New();
I would write:
sofa::component::controller::GeomagicDriver::SPtr geomDriver = addNew<sofa::component::controller::GeomagicDriver>(groot);
This should work.
Best,Hugo
HugoKeymasterHey Noura,
I think here is what you are looking for:
<?xml version="1.0"?> <Node name="root" gravity="0 0 0" dt="0.003" > <VisualStyle name="visualStyle1" displayFlags="showBehaviorModels showForceFields showInteractionForceFields showCollisionModels showWireframe" /> <EulerImplicitSolver rayleighStiffness="0.01"/> <CGLinearSolver iterations="50" tolerance="1e-06" threshold="1e-06"/> <FreeMotionAnimationLoop /> <GenericConstraintSolver tolerance="0.001" maxIterations="1000"/> <Node name="object1" activated="1" > <MechanicalObject name="MO_object1" template="Rigid" position="-0.010686 -0.012517 -0.021330 0 0 0 0" velocity="10 0 0 0 0 0 0"/> <UniformMass totalMass="0.1" /> <UncoupledConstraintCorrection compliance="1"/> <Node name="object1_surf" activated="1" > <MeshObjLoader name="loader" filename="object1.obj" /> <Mesh src="@loader" /> <MechanicalObject name="MO_object1_surf" template="Vec3d" src="@loader" dx="0.010686" dy="0.012517" dz="0.021330" showObject="1"/> <UniformMass totalMass="0.1" /> <UncoupledConstraintCorrection compliance="1"/> <RigidMapping input="@.." output="@MO_object1_surf"/> <Node name="VisualModel"> <OglModel name="Visual" src="@../loader" color="blue" dx="0.010686" dy="0.012517" dz="0.021330"/> <IdentityMapping input="@.." output="@Visual"/> </Node> </Node> </Node> <Node name="object2" activated="1"> <MeshSTLLoader name="meshLoader" filename="object2.stl" /> <Mesh src="@meshLoader"/> <MechanicalObject template="Vec3d" name="MO" src="@meshLoader" velocity="0 0 0"/> <UniformMass totalMass="1" /> <MeshSpringForceField name="deformable_object" stiffness="50000" damping="0.5" /> <ConstantForceField indices="0 2 15 21 27 32 " totalForce="-5000 0 0" arrowSizeCoef="0.1"/> <UncoupledConstraintCorrection compliance="1"/> <Node name="VisualModel"> <OglModel name="Visual" src="@../meshLoader" color="yellow" translation="0 0 0" /> <IdentityMapping /> </Node> </Node> <BilateralInteractionConstraint template="Vec3d" object1="@object1/object1_surf" object2="@object2" first_point= "147 660 659 658 346 " second_point="9 19 26 36 42" /> </Node>
Cheers
Hugo
24 September 2018 at 18:14 in reply to: [SOLVED] no "createScene" nor "createSceneAndController" module method found error #11998HugoKeymasterHey @zahra
Could you share with us the generated python file?
What version of SOFA are you using?
Source or binaries?Cheers,
Hugo
HugoKeymasterHey Nassim
Since we compiled together your SOFA on Windows, I will close this topic.
Best,Hugo
21 September 2018 at 11:50 in reply to: [SOLVED] Could you explain the difference between Geomaigc and sensible plugin? #11981HugoKeymasterYou are very welcome @suwan,
I close this topic but never hesitate if you have further questions.Best
Hugo
21 September 2018 at 11:45 in reply to: Runge Kutta issue: 'Segmentation fault (core dumped)' #11980HugoKeymasterCould you share with me (privately if needed) your mesh so that I can give a try with the entire scene?
What I meant to say is that you can not use the LinearSolverConstraintCorrection in your case since this ConstraintCorrection needs the system matrix from the solvers, which the RungeKutta does not built. Instead, you can use the UncoupledConstraintCorrection that does not need to system matrix to compute the compliance matrix, but uses a simplified (diagonal) matrix. You can specify the value on the Diagonal of this matrix with the data compliance in the UncoupledConstraintCorrection.
Is this more understandable? (sorry for the first unclear explanation).
Best
Hugo
21 September 2018 at 11:32 in reply to: How to connect two rigid parts while one would separate from the other halfway? #11979HugoKeymasterHi Wong,
I used one single particle for your object.
Then I map a collision model (any mesh that you want) on this particle.
And I can still control the particle (here using a LinearMovementConstraint.Here is the scene:
<Node name="root" gravity="0 0 0" dt="0.01" > <CollisionPipeline verbose="0" draw="0" /> <BruteForceDetection name="N2" /> <MinProximityIntersection name="Proximity" alarmDistance="0.8" contactDistance="0.5" /> <CollisionResponse name="Response" response="default" /> <VisualStyle name="visualStyle1" displayFlags="showBehaviorModels showCollisionModels" /> <EulerImplicitSolver rayleighStiffness="0.01"/> <CGLinearSolver iterations="50" tolerance="1e-06" threshold="1e-06"/> <Node name="Sphere"> <EulerImplicitSolver rayleighStiffness="0"/> <CGLinearSolver iterations="200" tolerance="1e-06" threshold="1e-06"/> <MechanicalObject template="Rigid" name="myParticle" position="-2 10 0 0 0 0 1" showObject="1" showObjectScale="0.5" /> <UniformMass totalmass="1" /> <ConstantForceField force="0 -1 0 0 0 0" /> <!-- <Sphere name="Floor" listRadius="1" simulated="1" moving="1" contactStiffness="100" /> --> <Node name="object1_surf" activated="1" > <MeshObjLoader name="loader" filename="mesh/cube.obj" scale="10"/> <Mesh src="@loader" drawTriangles="0"/> <MechanicalObject name="MO_object1_surf" src="@loader" showObject="1"/> <Triangle /> <Line /> <Point /> <RigidMapping input="@.." output="@MO_object1_surf"/> </Node> <LinearMovementConstraint template="Rigid" keyTimes="0 1 5 10 12" movements="0 0 0 0 0 0 0 0 0 0 0 0 0 0 -20 0 0 0 0 0 -20 0 0 60.3 0 0 0 0 0 60.3" /> </Node> </Node>
Is this want you want to do?
Cheers,
Hugo
HugoKeymasterHi @noura,
The AttachConstraint is a projective constraint and is templated. Therefore you need to carefully select the object you want to attach (with the same template).
In you case, the rigid MechanicalObject ‘MO_object1’ is the ‘master’ object for object 1, even if the physics occurs in on the deformable (since it has a template Vec3d) object 1 (MO_object1_surf). Why do you need this rigid MechanicalObject ‘MO_object1’?
I ran a simulation without this rigid MO and I added physics (stiffness and mass) to the MO_object1_surf and the AttachConstraint twoway worked well:
with one ConstantForce
with two ConstantForces
Scene :
<Node name="root" gravity="0 0 0" dt="0.01" > <VisualStyle name="visualStyle1" displayFlags="showBehaviorModels showForceFields showInteractionForceFields showCollisionModels showWireframe" /> <EulerImplicitSolver rayleighStiffness="0.01"/> <CGLinearSolver iterations="50" tolerance="1e-06" threshold="1e-06"/> <Node name="object1" activated="1" > <Node name="object1_surf" activated="1" > <MeshObjLoader name="loader" filename="object1.obj" /> <Mesh src="@loader" /> <MechanicalObject name="MO_object1_surf" template="Vec3d" src="@loader" showObject="1"/> <MeshSpringForceField name="deformable_object" stiffness="50000" damping="0.5" /> <UniformMass totalmass="1" /> <ConstantForceField indices="0 2 15 21 27 32" totalForce="50 0 0" arrowSizeCoef="1"/> <Node name="VisualModel"> <OglModel name="Visual" src="@../loader" color="blue" dx="0.010686" dy="0.012517" dz="0.021330"/> <BarycentricMapping input="@.." output="@Visual"/> </Node> </Node> </Node> <Node name="object2" activated="1"> <MeshSTLLoader name="meshLoader" filename="object2.stl" /> <Mesh src="@meshLoader"/> <MechanicalObject template="Vec3d" name="MO" src="@meshLoader" velocity="0 0 0"/> <UniformMass totalmass="1" /> <MeshSpringForceField name="deformable_object" stiffness="50000" damping="0.5" /> <Node name="VisualModel"> <OglModel name="Visual" src="@../meshLoader" color="yellow" translation="0 0 0" /> <IdentityMapping /> </Node> <ConstantForceField indices="0 2 15 21 27 32" totalForce="-50 0 0" arrowSizeCoef="1"/> </Node> <AttachConstraint object1="@object1/object1_surf" object2="@object2" indices1="147 660 659 658 346" indices2="9 19 26 36 42" constraintFactor="1 1 1 1 1" twoWay="true"/> </Node>
Best
Hugo
20 September 2018 at 19:09 in reply to: SIG 11 – SIGSEGV: segfault Segmentation fault (core dumped) #11973HugoKeymasterThank you for your strong involvement @meldiwiny
Do not hesitate to let us know about the outcome of your discussionCheers
Hugo
HugoKeymasterDear @starkovr
Thank you very much for your interest and curiosity about SOFA!
I am afraid that – at my best knowledge – no plugin exists interfacing SOFA with Ascension devices. We would be glad to see a new interface plugin, if you feel to do so 😉Cheers
Hugo
20 September 2018 at 19:03 in reply to: [SOLVED] Could you explain the difference between Geomaigc and sensible plugin? #11970HugoKeymasterDear @suwan,
The Sensable plugin is actually the plugin associated to the old version of the haptic device. Now, everyone should move to Geomagic.
Best regards,
Hugo
13 September 2018 at 18:54 in reply to: [SOLVED] How can I get the local frames in TetrahedralCorotationalFEMForceField? #11941HugoKeymasterHi @outtt
I have really no idea what you are talking about when you mention these “frames”.
Can you explain a bit please?Best
Hugo
13 September 2018 at 18:54 in reply to: How to completely prevent penetration when collision occurs? #11940HugoKeymasterHi @outtt
if the simulation slows down, it means the computation becomes more complicated. Hard to make it more efficient. You can:
– decrease the refinement of your collision mesh
– try to increase the stiffness of your collision modelsLet me know if this helps.
I did not use the Geomagic for some weeks. As soon as I use it again, I will give a try to your scene.Best
Hugo
HugoKeymasterWhat kind of forces do you want to apply on your cell?
You could write your own xml scene, by getting inspired by the examples files in examples/Components/forcefield/As I said, we are working on new tools to build a simulation and fix the tutorials.
Hugo
HugoKeymasterHey @agniv
Sorry for the delay of my reply, but your question is not trivial.
The SOFA API implements a reset() visitor, reseting all components of the simulation. To do so in Python, all you need to do is:
rootNode.reset()
However (yes, otherwise it would be an easy answer), the reset() function inherited in all SOFA classes is NOT always implemented (or well-implemented). Therefore, to make sure that the reset does what you want, you should check the reset() function of the components used in your scene.
Another solution would be to make the reset yourself: reseting the state vectors of the MechanicalObject (position, velocity, force, constraint ..) and all other classes.
Another solution would be to create a new node at each new force you want to apply and deactivate the node
node.activated=0
when the simulation is over.Does this help a bit ?
Best wishes,Hugo
HugoKeymasterHey @ant0nin
I never did such a full-python test scene. I would rather 1) create a usual simulation, as you are doing with
sofa::simulation::setSimulation(simulation = new sofa::simulation::graph::DAGSimulation());
2) add a RequiredPlugin component loading the SofaPython.so library in your root node and 3) add a PythonScriptController loading your python script.Have you tried this?
Cheers,Hugo
HugoKeymasterHi rubab,
Why are you using the Modeler, since it is deprecated?
What do you want to model?
Did you have any compilation error?Best,
Hugo
11 September 2018 at 19:39 in reply to: [SOLVED] How to give multi-physical properties to one tetrahedron object #11927HugoKeymasterHey @suwan,
Let me reply point by point:
1) in TetrahedronFEMForcefield, the data localStiffnessFactor is a list of factor values, you can set a localStiffnessFactor for each tetrahedron. I think you could read this from a file using a trick:
<MeshObjLoader template="Vec1d" name="myStiffnessLoader" filename="myFileWithLocalStiffnessFactor.obj" /> ... <TetrahedronFEMForcefield localStiffnessFactor="@myStiffnessLoader.position" />
I am not sure it will work, do not hesitate to let me know.
2) Could you explain meaning of i*M/N more?
It means that if stiffness=1000, localStiffnessFactor = “0.5 2 3” and you have 1200 tetrahedra in your mesh, then:
– the stiffness of the first 400 (0-399) tetra (1/3) equals 1200*0.5=600
– the stiffness of the tetra 400-799 (2/3) equals 1200*2=2400
– the stiffness of the tetra 800-1199 (3/3) equals 1200*3=3600Best regards,
Hugo
HugoKeymasterHi @rubab,
This is the final warning: please stop double-posting your questions on the forum, you are polluting it.
The SOFA community is very busy and we try to reply as quickly as possible.
We already noticed this in multiple posts on the forum: the Modeler is deprecated, we do not support it anymore.
Regarding your issue, it is a compilation problem. First make sure all your projects are successfully built, before trying to run SOFA. We can assist you only if you share your compilation errors.
Cheers
Hugo
-
AuthorPosts