Forum Replies Created
-
AuthorPosts
-
Hugo
KeymasterHi @bobiko
Yes this is correct. But the GPU versions might be in some private plugins developed in different teams. Let me probe the devs and get back to you, but it won’t be before the end of the month (due to several colleagues away for summer holidays)
Hugo
Hugo
KeymasterHugo
KeymasterYou are touching a hot topic!
We are currently discussing and changing the API of SOFA to make sure that updates can be made and are properly and consistently taken into account on the fly during the simulation.Can you specify what you intend to do exactly? Why and which values you need to update? (just for my understanding)
Hugo
Hugo
KeymasterHi @hujiobd
Sorry for the delay of reply, people are currently in vacations!
Thank you for your interest in SOFA and welcome on our open forum.Yes SOFA as a physics engine is made for interacting, applying forces or displacement on bodies. Exporting stresses is something which can be a bit tricky but we can assist in this as well.
To start with SOFA, I would read the online documentation, have a look at all the XML examples available in examples/Components/ and start writing your own XML case. Then I would pass to Python.
If you need it, we are also providing online courses to shortly introduce SOFA and its main principles.
Best,
Hugo
Hugo
KeymasterHi @eugenekli
Any update? Did you solve your issue?
If not, you can detail your problem and share your scene.Best
Hugo
Hugo
KeymasterHi @sayan957
Sorry for the delay, I guess Damien is currently away.
In the video you saw, the simulation computes the forces to send to the actuators/motors. So the answer is yes.
For your second question, this can be specified in the “ForceField” in SOFA where you can associate to each tetrahedron a different stiffness value.
Best
Hugo
13 August 2019 at 18:04 in reply to: [SOLVED] Attach constraint and Fixed constraint difference #14098Hugo
KeymasterIt is a good questions.
The FixedConstraint is a ProjectiveConstraint, which will enforce a zero velocity on specific points of your model.
The AttachConstraint is a PairInteractionConstraint (documentation is missing for now, but we work on it). This component aims at satisfying the constraint defining that two points of two different models (“paired models”) have the same position. In your case of of the two models (red balls) are fixed. So it should give the same result. To get the same result (same physics), you should activate the option twoWay. This option makes sure that forces are projected back from model2 to model1.Still, could you share the scene you wrote with the AttachConstraint please?
Best
Hugo
Hugo
KeymasterHi @eyadshak
I know on Linux I got issues since environment variables need to be set and are conflicting, in my case, with QtCreator.
Just to check could you run this command in your Linux terminal:
echo $QT_PLUGIN_PATH
Hugo
Hugo
KeymasterHi @ma1991
Thanks for the details.
Again, modeling yarn (and all collisions / contacts of it) can be very complex.If I undertstood correctly, you are trying to create a volumetric mesh from a stl mesh, is that corerct? If so, could you share this stl mesh?
But the SOFA community is more for modeling and less for meshing questions.
Hugo
Hugo
KeymasterHey @avihs98
You can simply modify in the source code of runSofa, line 408 (located in applications/projects/runSofa/Main.cpp):
the file path with your own file path. And then recompile. runSofa will afterwards automatically run your scene file by default.Best,
Hugo
Hugo
KeymasterHi @ma1991
It seems many questions are still open. You should maybe work on this first, before going into the simulation.
It is difficult to model cloth from the yarn scale. Both on the meshing and simulation standpoint.
What is your final objective in term of modeling?Note that pseudo of Stefan is @sescaida
BestHugo
Hugo
KeymasterSeveral solutions then:
– you can open it with runSofa.exe
– or you can create a batch file launching directlyrunSofa path/to/your/file.xml
– or you can change the default scene of runSofa
– or modify the Main.cpp (C++) of runSofa so that it opens directly your xml file.Hugo
Hugo
KeymasterHi @avihs98
I just took two random points.
If you want to visual the point IDs just activate the options showIndices and showIndicesScale in the associated MechanicalObject (as mentioned above).
Hugo
Hugo
KeymasterHey @avihs98
Congratulations for your cloth simulation.
Did you write it as an XML scene file? a Python file? a C++ file?Best
Hugo
Hugo
KeymasterHi @bobiko
I tested myself on another computer. It works.
Here is a simplified patch.All you need is to:
– apply this patch (in the sources)git apply EngineExportOrientationEuler.patch
– compile again
– run this example scene:<Node name="root" dt="0.005" > <RequiredPlugin name="SofaOpenglVisual" /> <RequiredPlugin pluginName="CImgPlugin" /> <RequiredPlugin name="SofaPython" /> <VisualStyle displayFlags="hideBehaviorModels hideCollisionModels hideMapping hideForceFields" /> <LightManager ambient="1 1 1 1"/> <Gravity name="G" gravity="0 0 0" /> <DefaultPipeline name="pipeline" depth="6" verbose="0" /> <BruteForceDetection name="detection" /> <DefaultContactManager name="response" response="FrictionContact" /> <LocalMinDistance name="proximity" alarmDistance="0.04" contactDistance="0.02" angleCone="0.0" /> <FreeMotionAnimationLoop/> <LCPConstraintSolver tolerance="1e-5" maxIt="1000" /> <!-- <include name="Uterus" href="uterus_fem.xml" /> --> <!-- <include name="Instrument" href="instrument.xml" position="0 -2 0 0 0 0 1.0"/> --> <Node name="Instrument" > <EulerImplicitSolver name="ODE solver" rayleighStiffness="0.05" rayleighMass="1.0" /> <CGLinearSolver name="linear solver" iterations="50" tolerance="1e-10" threshold="10e-10" /> <MechanicalObject name="instrumentState" template="Rigid3d" position="0 0 0 0 0 0 1.0" showObject="1" showObjectScale="1" /> <UniformMass name="mass" totalMass="0.1" /> <UncoupledConstraintCorrection/> <Node name="VisualModel" > <MeshObjLoader name="VisualLoader" filename="mesh/liver.obj" /> <!-- <OglModel name="InstrumentVisualModel" color="red" src="@VisualLoader" /> --> <RigidMapping name="MM->VM mapping" input="@instrumentState" output="@InstrumentVisualModel" /> </Node> <Node name="CollisionModel" > <MeshObjLoader filename="mesh/liver.obj" name="loader"/> <MeshTopology src="@loader" name="InstrumentCollisionModel" /> <MechanicalObject src="@loader" name="instrumentCollisionState" /> <LineCollisionModel name="instrumentLine" contactStiffness="10" /> <PointCollisionModel name="instrumentPoint" contactStiffness="10" /> <TriangleCollisionModel name="instrumentTriangle" contactStiffness="10" /> <RigidMapping name="MM->CM mapping" input="@instrumentState" output="@instrumentCollisionState" /> </Node> <!-- <VectorSpringForceField object1="@Input/RefModel/instrumentCollisionState" object2="@Instrument/CollisionModel/instrumentCollisionState" stiffness="10" viscosity="0" /> --> <Node name="Camera" > <MechanicalObject template="Rigid3d" name="CameraState" rz="90" /> <RigidToQuatEngine name="EngineExportingOrientationEuler" rigids="@CameraState.position" /> <RigidRigidMapping /> </Node> </Node> <MeshObjLoader name="VisualLoader" filename="mesh/liver.obj" translation="10 -5 -5" /> <OglModel name="FixedVisualModel" src="@VisualLoader" color="blue"/> <OglViewport screenPosition="0 0" screenSize="300 300" zNear="0.01" zFar="10" cameraPosition="@Instrument/Camera/CameraState.position" drawCamera="0" /> <SpotLight name="LightSource" color="0 0 1" position="@Instrument/Camera/CameraState.position" direction="@Instrument/Camera/EngineExportingOrientationEuler.orientationsEuler" cutoff="25" exponent="1" drawSource="0"/> </Node>
As you can see the OglViewport can be directly connected to the Rigid MechanicalObject:
cameraPosition="@Instrument/Camera/CameraState.position"
while the SpotLight needs both the position :
position="@Instrument/Camera/CameraState.position""
and the orientation:
direction="@Instrument/Camera/EngineExportingOrientationEuler.orientationsEuler"
Best,
Hugo
29 July 2019 at 11:51 in reply to: [SOLVED] undefined reference to 'boost::program_options::abstrac_variables_map::operator' #14016Hugo
KeymasterGreat that it worked!
Thanks for the feedback!Hugo
Hugo
KeymasterHi @bobiko
As you want, but the patch I sent you would expose a directional vector (Euler angles) instead of using the quaternion of the Rigid.
Let us know whenever you make it.Hugo
Hugo
KeymasterHi @bobiko
the Rigid MechanicalObject defines one frame: x,y,z + quaternion.
If you want the light to also follow the orientation indeed to solution:
– you can do it with a PythonScriptController by extracting the quaternion info and transform it in a Euler angle to provide to the Camera
– you can implement this in C++. I did it for you in the existing class RigidToQuatEngine. Please find here the git patch to apply: EngineExportOrientationEuler.patch
Note to apply a git patch, just follow git instructions. If it compiles and works for you, could you please pull-request this change in the GitHub repository of SOFA please?Best
Hugo
Hugo
KeymasterHi @avihs98
Just change the field “indices” in the FixedConstraint.
You will see that using these indices the Constraint works well.<FixedConstraint indices="3010 3050" />
Again let us know when you have successfully remeshed your disk.
Hugo
Hugo
KeymasterOn Windows, you should find it under:
SOFA_v19.06.00_Win64\share\sofa\examples\Hugo
Hugo
KeymasterDid you use the installer for Windows?
Hugo
KeymasterHugo
KeymasterOf course.
Here you are:<MechanicalObject showIndices="1" showIndicesScale="0.005" />
Hugo
Hugo
KeymasterHi @avihs98
I think your mesh have some issue, especially on the border. In the mechanicalObject you can activate the Visualization with showIndices=”1″ and you can see that at the border of the disk, two points are always overlapping. I gues some points are not connected to the rest of the mesh.
Look, if you use instead the indices=”3010 3050″ it works.
I would go for a remeshing or at least analyzing the mesh connectivity.Hugo
-
AuthorPosts