Forum Replies Created
-
AuthorPosts
-
HugoKeymaster
Hi @sarah
Using python you have plenty of possibility.
Two options here:- in your python script, you can use a VTKExporter specifying the filename and exportAtEnd=”1″ and when the simulation will close, a file will be generated (vtk/vtu format can be visualize with Paraview)
node.createObject('VTKExporter', name='exporter', filename='my_output_filename', position='@MechanicalObject.position', pointsDataFields='@MechanicalObject.velocity')
- when you want your simulation to stop (t=xx s), you can directly access the mechanical object of interest and get the value of its position, velocity, force datafield. There, you can export it as csv (example)
I hope this helps
Hugo
17 March 2020 at 20:11 in reply to: [SOLVED] Available objects in the factory (python or xml) #1543417 March 2020 at 20:11 in reply to: [SOLVED] Available objects in the factory (python or xml) #15433HugoKeymasterHey @bobiko
Great to see you again!
Hope everything is fine despite Covid19.Which version are you using of SOFA?
– binary? which release?
– source? which release/branch/version?Can you find the location of the libSofaOpenglVisual.so yourself?
Best,
Hugo
HugoKeymasterWelcome on the forum @matfit
Indeed changing just one mesh in the liver demo scene will not work. This is due to the fact that in SOFA, one object (e.g. a kidney) can have different representations/topologies:
- a mechanical model (e.g. a volumetric mesh on which will be computed the FEM)
- a visual model (e.g. surface mesh used only for the rendering)
- a collision model (e.g. surface mesh used to compute discrete collision)
The mapping creates links these different representations to keep them coherent (e.g. when the mechanical model deforms, we want the visual model to move accordingly).
By changing the visual mesh in the liver demo, the visual model was the one of the kidney while the mechanical model was the liver volumetric mesh. Both can not be linked.
As you understood, you need to create a volumetric mesh from your STL for the mechanics. For this purpose, you can use any mesh generator of your choice (MeshLab, CGAL or others). FYI, we have a CGAL plugin in SOFA. We have also a basic tool mesh generating volumetric tetra-meshes from surfaces: MeshTetraStuffing. Check out the examples: examples/Components/misc/MeshTetraStuffing.scn
Cheers,
Hugo
PS: for your info, we also provide dedicated training sessions on SOFA, if you need more background on physics, maths, numerical analysis and simulation.
HugoKeymasterGreat thanks @remibessard!
Yes, please @vincent keep us posted! I am eager to see some of your oversea-results!Cheers,
Hugo
HugoKeymasterHi @sarah
Welcome on the forum!
Sorry for the delay, we needed to setup due to Covid19.Are you using XML or Python file for defining your simulation?
When would you like this export to happen? How would you like to get this export (as a file)?Depending on your needs, I will provide you the best option.
Best,Hugo
17 March 2020 at 18:01 in reply to: [SOLVED] Available objects in the factory (python or xml) #15423HugoKeymasterHugoKeymasterThanks for reporting again @qzha862
I will investigate and get back to you asap.Are you compiling everything in Debug or Release?
Could you please post the exact error?Best,
Hugo
HugoKeymasterhey @balazs
The SofaPython3 is no more in transient phase, it is stable. Obviously developments in this project continue but it’s only a sign of good health! The plugins are not all yet compatible with this SofaPython3 but it will come soon.
You would like to compare at each time step an image and the resulting point of view in the simulation. Is this correct?
Hugo
HugoKeymasterThank you Wong for properly noticed Olivier.
HugoKeymasterHi @outtt
I will point out your post to the author.
I would like to profit from it to emphasize how important it is for an open-source community like to SOFA to get such open contributions!If you (all) have small bugfixes, new models, algorithms or any other contributions (tutorial video, documentation etc), it will be more than welcome!
Best wishes,
Hugo
HugoKeymasterHi @outtt
I guess it is a vtu (volumetric) tetra mesh generated from the snake.obj mesh (from the default caduceus scene). Can you confirm @olivier ? did someone just forget to push it?
Best
Hugo
5 March 2020 at 14:37 in reply to: [SOLVED] RigidMapping from Rigid3d to only some particles of FEMbody #15291HugoKeymasterOups sorry I did not refresh the page Damien;)
Thanks for your answer!5 March 2020 at 14:36 in reply to: [SOLVED] RigidMapping from Rigid3d to only some particles of FEMbody #15290HugoKeymasterHey @simon
I think what you actually want to achieve is called : rigidification.
You have one (not very clean) example: examples/Components/animationloop/MechanicalMatrixMapper.pyscnHere is another example in STLIB.
Let me know if this helps.
BestHugo
HugoKeymasterHi @azad
The warning you are referring to us to the fact that the libraries shipped with the SOFA binaries are indeed hiding system libraries. This is normal, no worries.
Regarding the out-of-tree compilation of the STLIB plugin, it is stranger though. Did you set all required CMake variable (like PREFIXPATH)?
Did you already succeed to compile this plugin before?Best
HUgo
HugoKeymasterHi @oscarg29 and welcome on the forum!
First of all, it must be noticed that you are using several private plugins, not available in the open core of SOFA. Is it correct? (I see AdaptiveBeamForceFieldAndMass or PositionEffector)
When you say that you apply a translation on the end-effector, where are you defining it in the scene file?
For translation/rotation transformation, we usually use the TransformEngine.
Hugo
4 March 2020 at 18:48 in reply to: [SOLVED] RigidMapping from Rigid3d to only some particles of FEMbody #15282HugoKeymasterHey @simon
In your current scene, it is strange to have so many solvers and integration schemes. Normally you have one per object, or one for several objects. But here you have 3 solvers and 2 objects!
Moreover, I think the BilateralInteractionConstraint does correspond better to your needs. Here is an example:
<?xml version="1.0" ?> <Node name="lroot" gravity="0 -10 0" dt="1e-5"> <VisualStyle displayFlags="showForceFields showBehavior" /> <RequiredPlugin name="SofaPython" pluginName="SofaPython" /> <FreeMotionAnimationLoop /> <GenericConstraintSolver maxIterations="1000" tolerance="0.001"/> <Node name="ParticleControl" > <TransformEngine template="Rigid3d" name="engine" input_position="0 0 0 0 0 0 1" /> <EulerImplicitSolver name="EulerImplicit" rayleighStiffness="0.1" rayleighMass="0.1" /> <CGLinearSolver name="CG Solver" iterations="25" tolerance="1e-5" threshold="1e-5"/> <MechanicalObject template="Rigid3d" name="myRigidParticleForRotation" position="@engine.output_position" showObject="true" showObjectScale="5"/> <UncoupledConstraintCorrection /> <Node name="Constraints"> <MechanicalObject name="points" template="Vec3d" position="0 15 10 0 15 -10 0 -15 -15 0 -15 10" showObject="true" showObjectScale="5"/> <RigidMapping /> </Node> </Node> <Node name="beam"> <EulerImplicitSolver name="cg_odesolver" rayleighStiffness="0.5e-5" rayleighMass="0.0" /> <CGLinearSolver name="linear solver" iterations="25" tolerance="1e-09" threshold="1e-09" /> <MeshGmshLoader name="meshLoader" filename="beam_hexa_coarse_01_mod.msh" /> <HexahedronSetTopologyContainer name="topo" src="@meshLoader" /> <MechanicalObject name="dofs" src="@meshLoader" showObject="true" /> <HexahedronSetGeometryAlgorithms template="Vec3d" name="GeomAlgo" /> <DiagonalMass name="computed using mass density" massDensity="7.85e-09" /> <HexahedronFEMForceField template="Vec3d" name="FEM" method="large" poissonRatio="0.3" youngModulus="2.1e5" /> <UncoupledConstraintCorrection /> </Node> <BilateralInteractionConstraint object1="@ParticleControl/Constraints/points" object2="@beam/dofs" first_point="0" second_point="2" /> <BilateralInteractionConstraint object1="@ParticleControl/Constraints/points" object2="@beam/dofs" first_point="1" second_point="3" /> <BilateralInteractionConstraint object1="@ParticleControl/Constraints/points" object2="@beam/dofs" first_point="2" second_point="1" /> <BilateralInteractionConstraint object1="@ParticleControl/Constraints/points" object2="@beam/dofs" first_point="3" second_point="0" /> </Node>
HugoKeymasterHi @benjamin
If I understand you correctly, you have two rigid frames. And you would like them to only move along one axis? is this correct?
I guess you already took a look at the Sliding constraint?
What is your actuator supposed to do?
Best
Hugo
HugoKeymasterOupsi, Jean Nicolas is right.
It was no linking error but a unknown symbol, so an include missing!HugoKeymasterHey @jjcasmar good to see you again!
Indeed, linking issue.
It appears you have a linking issue related to the function ::apply().To know where it comes from, please run:
ldd YOUR_PLUGIN.so
Could you also share with us the dependencies of your plugin? More especially what did you wrote in your CMakeLists.txt in the
target_link_libraries( ... )
command?Cheers
Hugo
3 March 2020 at 16:08 in reply to: [SOLVED] One object with different collision definitions for different parts #152683 March 2020 at 16:07 in reply to: [SOLVED] BilateralInteractionConstraint reduces gravity by 100x #15267HugoKeymasterHi @joshuaf
Sorry for my latency, I am in the middle of different administrative things!
I really must thank you for investigating further with a full-rigid approach. It definitely helps: since it shows that the problem comes from the computation of the implicit part of the internal forces (mechanical model) with these constraints.
It is therefore a very good clue.
Let me further dig into this and I get back to you asap.Best
Hugo
HugoKeymasterOk thank @azad you for the notice.
I guess you are referring not the SOFA binaries but the SoftRobot binaries. Is it correct?
There is no official support for this since it is a separate work from a research team. New binaries have recently been generated and should be soon released by the team.Let us know if you have any other question / issue with STLIB, I would put you in touch with the research team!
Best,
Hugo
- in your python script, you can use a VTKExporter specifying the filename and exportAtEnd=”1″ and when the simulation will close, a file will be generated (vtk/vtu format can be visualize with Paraview)
-
AuthorPosts