Forum Replies Created
-
AuthorPosts
-
25 March 2021 at 08:57 in reply to: [SOLVED] Export Graph Button causes runSofa to segfault (SIGSEGV) and crash #18980HugoKeymaster
Dear @olumide
This is strange: I did not face this issue on Linux (Ubuntu).
You are using v20.12.01 (binary) apparently right?Hugo
HugoKeymasterI am sorry to read this, I will see this with our release manager and get back to you.
Best wishes,Hugo
24 March 2021 at 08:31 in reply to: [SOLVED] Many ‘nan’ values in EulerImplicitSolver log for TetrahedronFEMForceField #18968HugoKeymasterHi @pzingg
Thanks for writing us the solution to your problem.
The Poisson ratio must be <0.5 (strictly) for any elastic material. The value of 0.5 is a theoretically value corresponding to perfect imcompressibility of the material.Did you have a warning from the TetrahedronFEMForceField at the initialization of the scene about your poissonRatio=0.5 ? If no, it would be nice to PR such a check. Would you mind doing it?
Best wishes,
Hugo
HugoKeymasterGreat to read !
Thanks for having closed the topic. Feel free to open a new one anytime!Best
Hugo
18 March 2021 at 19:49 in reply to: Simulating deformation of a simple set of beams via BeamFEMForceField #18922HugoKeymasterHi @andrija987
I am not myself working extensively with rigids, and I never noticed that the FixedRotationConstraint was applied on all points. From what I understand, you would like to couple both the FixedConstraint and FixedRotationConstraint but only on some indices. Is this correct?
If so, you (if you feel to do it, it’s the best way to learn) or I (if I have some time) could implement this.Promotion of SOFA, citations are always most welcome within the open-source community. The more we are, the better the project will become!
We could chat with the next weeks, if you’d like. I would be interested to learn more about your project.
Best wishes,Hugo
HugoKeymasterHey @eaparra
Sorry for my misunderstanding.
Yes, you can input/output data from a SOFA simulation within your native python environment, to possibly send them to another program.Best wishes,
Hugo
HugoKeymasterHey @eaparra
My link wasn’t good I guess.
Here is the repo: https://github.com/SofaDefrost/sofa/tree/sofaCommunication
The Communication plugin will be included in SOFA as a plugin (to activate in the CMake configuration phase)Best
Hugo
HugoKeymasterHey @eaparra
Only using the v20.12(.01) which allows to use SOFA from a native python environment.
Once you have compiled SOFA and the SofaPython3 plugin, you will have to :
export SOFA_ROOT=/path/to/SOFA
export PYTHONPATH=$path/to/build/of/SofaPython3/lib/python3/site-packages
then you will be able to run any simulation (written as a python script) from a python environment as follows:
python3.7 $path/to/your/scene/simulation.py
I hope this helps.
FYI, I will make sure the doc on SofaPython3 (and its usage) will improve.Best,
Hugo
18 March 2021 at 14:51 in reply to: [SOLVED] Questions regarding the installation of SofaPython3 plugin #18914HugoKeymasterHi @mdubied
Ok so you are well using the v20.12.01 (latest release) of SOFA. Great!1) both work well! it is really up to you!
2) Compilation guidance are available here: https://github.com/sofa-framework/SofaPython3/blob/2bbdb9b937be9926b74d4cbd88c2c93b6dfcc115/docs/sphinx/source/menu/Compilation.rst
(and this will soon be directly available in the SofaPython3 doc)Best wishes,
Hugo
HugoKeymasterHey @eaparra
What @guillaumeparan meant is that you can test the pull-request within which a Communication plugin was integrated within SOFA. However, this work in not integrated within the current/recent version of SOFA.
To download it and test it:
git clone -b sofaCommunication https://github.com/SofaDefrost/sofa
But – as explained – this corresponds to an old version of SOFA.
Best,Hugo
18 March 2021 at 08:08 in reply to: [SOLVED] Questions regarding the installation of SofaPython3 plugin #18907HugoKeymasterYes perfect @mdubied
In the sources of SOFA ($HOME/sofa/src), could you launch:git log
and share with us the output?Best
Hugo
HugoKeymasterDefinitely.
Have you already opened one @pasquale94?HugoKeymasterHi @eaparra
You are never bothering! We are now trying to browse all forum questions once a week, to improve our support quality.
I am not sure to understand what you mean by a simulation “with mass and without mass”.
Do you want to run a dynamic and a static simulation?Best wishes,
Hugo
HugoKeymasterHi @quantanovo
I understand that you have updated your SOFA (and SofaPython3) sources and compiled again. Despite this it does not work properly. Is this correct?
Could you tell me what a “git log” command gives you from the SOFA sources?
Are you fetching SofaPython3 when configuring the project in the CMake phase ?Best,
Hugo
17 March 2021 at 22:35 in reply to: Simulating deformation of a simple set of beams via BeamFEMForceField #18875HugoKeymasterHi @andrija987
Could you tell me what you mean by “problem to orient the lines to follow the direction how my nodes”?
I am not sure to understand the problem.To visualize the lines I just modified the MeshTopology line as follows:
mechanics.createObject("MeshTopology", name="lines", lines="0 1 1 2 2 3 3 4", position="@DOFs.position", drawEdges="1")
Note that the orientation of each frame connecting the beam is defined in the quaternion part in the degrees of freedom : x y z + quaternion (=Rigid3d)
Best
Hugo
17 March 2021 at 21:48 in reply to: [SOLVED] Questions regarding the installation of SofaPython3 plugin #18871HugoKeymasterHi @mdubied
Sorry I was away these last days!
When you say that you installed SOFA:
– which version did you install? v20.12.00 or v20.12.01? Make sure you use the latter
– is it the sources which you compiled? or the binaries?Best
Hugo
HugoKeymasterHey @newbie
I think @amendiza is using a private plugin named OpenCVPlugin while you are using the SofaCV plugin which is open. I am personnaly in favor of using as much as possible the open-source versions.
If I remember properly from this post you successfully compiled it, right?
Problem solved @amendiza ?
Best
Hugo
HugoKeymasterHi @pasquale94
It’s been a long time I have not read about Prony series and Maxwell model!
In SOFA:
– the hyperelastic material is only in charge of the hyper-elastic forces and no damping is added
– no component is implementing damping based on Prony series to my best knowledge
– I think something that could be close to Maxwell modeling would be the Rayleigh stiffness damping coefficient
– finally, nothing prevent from implementing a new damping forcefield integrating in each finite element the damping model you would likeLet me know if this helps.
BestHugo
HugoKeymasterHi @timp
I am sorry it took me some time to find out the issue (without mentioning the fact that I am just coming back from some days off).
The problem comes from the fact that you can not have collision computed on the attached area. Otherwise the collision and the bilateral constraint would be contradictory: one is attaching the two objects, while the other is repulsing the same two objects.
Here is a version of the scene working for my version of SOFA (latest master branch):
import Sofa import os def createScene(rootNode): ########################################## # Scene setup # ########################################## rootNode.createObject('RequiredPlugin', name='SofaPython') rootNode.createObject('RequiredPlugin', name='SofaSparseSolver') rootNode.createObject('VisualStyle', displayFlags='showVisualModels showBehaviorModels hideCollisionModels hideBoundingCollisionModels') rootNode.createObject('OglSceneFrame', style='Arrows', alignment='TopRight') rootNode.findData('gravity').value='0 0 0' rootNode.createObject('FreeMotionAnimationLoop') rootNode.createObject('GenericConstraintSolver', maxIterations='1000', tolerance = '0.001') rootNode.createObject('DefaultPipeline') rootNode.createObject('BruteForceDetection', name='N2') rootNode.createObject('DefaultContactManager', response='FrictionContact', responseParams='mu=0.6') rootNode.createObject('LocalMinDistance', name='Proximity', alarmDistance='2.0', contactDistance='0.5') ########################################## # Cube # ########################################## cube = rootNode.createChild('cube') cube.createObject('EulerImplicitSolver', name='odesolver_cube') cube.createObject('SparseLDLSolver', name='LDLsolver') cube.createObject('MeshVTKLoader', name='loader', filename='mesh/cube.vtk', rotation='180 0 0', translation='0 30 0') cube.createObject('TetrahedronSetTopologyContainer', src='@loader', name='container') cube.createObject('TetrahedronSetTopologyModifier') cube.createObject('TetrahedronSetGeometryAlgorithms', template='Vec3d') cube.createObject('MechanicalObject', name='MO_cube', template='Vec3d') cube.createObject('TetrahedronFEMForceField', template='Vec3d', name='FEM_cube', method='large', poissonRatio='0.3', youngModulus='200') cube.createObject('UniformMass', totalMass='0.0008') cube.createObject('LinearSolverConstraintCorrection', solverName='LDLsolver') cube.createObject('BoxROI', name='cubeROI_fix', box='20 -2 -20 -20 2 20', drawBoxes='true', position='@MO_cube.rest_position', tetrahedra='@container.tetrahedra') cube.createObject('FixedConstraint', indices='@cubeROI_fix.indices') #cube/cubeVisu cubeVisu = cube.createChild('visualModel') cubeVisu.createObject('MeshSTLLoader', filename='mesh/cube.stl', name='loader', rotation='180 0 0', translation='0 30 0') cubeVisu.createObject('OglModel', name='visual', src='@loader', color='0.5 0.8 0.2 0.5') cubeVisu.createObject('BarycentricMapping') #cube/cubeInterfacePoints cubeInterPts = cube.createChild('cubeInterfacePoints') cubeInterPts.createObject('MeshSTLLoader', filename='mesh/cube_surface.stl', name='loader', rotation='180 0 0', translation='0 30 0') cubeInterPts.createObject('MeshTopology', position='@loader.position', triangles='@loader.triangles', name='mesh_cubeInterface') cubeInterPts.createObject('MechanicalObject', name='pointCloud_cube', template='Vec3d', showObject='1', showObjectScale='15') cubeInterPts.createObject('SubsetMapping') ########################################## # Cuboid # ########################################## cuboid = rootNode.createChild('cuboid') cuboid.createObject('EulerImplicitSolver', name='odesolver_cuboid') cuboid.createObject('SparseLDLSolver', name='LDLsolver') cuboid.createObject('MeshVTKLoader', name='loader', filename='mesh/cuboid.vtk', rotation='0 0 90', translation='15 45 0') cuboid.createObject('TetrahedronSetTopologyContainer', src='@loader', name='container') cuboid.createObject('TetrahedronSetTopologyModifier') cuboid.createObject('TetrahedronSetGeometryAlgorithms', template='Vec3d') cuboid.createObject('MechanicalObject', name='MO_cuboid', template='Vec3d') cuboid.createObject('TetrahedronFEMForceField', template='Vec3d', name='FEM_cuboid', method='large', poissonRatio='0.3', youngModulus='500') cuboid.createObject('UniformMass', totalMass='0.0008') #cuboid.createObject('UncoupledConstraintCorrection') cuboid.createObject('LinearSolverConstraintCorrection', solverName='LDLsolver') #cuboid/cuboidVisu cuboidVisu = cuboid.createChild('visualModel') cuboidVisu.createObject('MeshSTLLoader', filename='mesh/cuboid.stl', name='loader', rotation='0 0 90', translation='15 45 0') cuboidVisu.createObject('OglModel', name='visual', src='@loader', color='0.1 0.6 0.5 0.5') cuboidVisu.createObject('BarycentricMapping') #cuboid/cuboidConnection cuboidConn = cuboid.createChild('cuboidConnection') cuboidConn.createObject('MeshSTLLoader', filename='mesh/cube_surface.stl', name='loader', rotation='180 0 0', translation='0 30 0') cuboidConn.createObject('MeshTopology', position='@loader.position', triangles='@loader.triangles') cuboidConn.createObject('MechanicalObject', name='pointCloud_cuboid', template='Vec3d', showObject='1', showObjectScale='5') cuboidConn.createObject('BarycentricMapping') ########################################## # Bilateral Interaction Constraint # ########################################## id_pts="" for i in range(len(cubeInterPts.getObject('mesh_cubeInterface').findData('position').value)): id_pts= id_pts+str(i)+" " rootNode.createObject( 'BilateralInteractionConstraint', name='BIC', template='Vec3d', object1='@cube/cubeInterfacePoints/pointCloud_cube', object2='@cuboid/cuboidConnection/pointCloud_cuboid', first_point=id_pts, second_point=id_pts, ) return rootNode
I hope this helps.
Best,Hugo
HugoKeymasterHey @sukhraj
I tested it myself it indeed returns this warning at the beginning (apparently the camera considers that neither the position, orientation nor the lookAt are set by the user – even if they are indeed defined).
The components clearly appears to have a problem.
Could you please open an issue copying-pasting your post on GitHub please?Best,
Hugo
HugoKeymasterHi @pzingg
Welcome to SOFA!
SOFA and the plugin SofaPython3 are officially supported by the SOFA consortium staff. STLIB is a plugin developed by one of the community team. We are therefore no expert of it.Could you detail us here the scene you have written please?
We will try to investigate. However, the message is quite explicit: a ODE solver is missing.I am sure we will quickly help you.
BestHugo
HugoKeymasterHi @twxu
Good question.
To get such geometrical information, your C++ code must define a pointer a SetGeometryAlgorithms. For instance, you can find such computation on triangles in the MeshMatrixMass.h code :sofa::component::topology::TriangleSetGeometryAlgorithms<GeometricalTypes>* triangleGeo;
and its usage in MeshMatrixMass.inl :
triangleGeo->computeRestTriangleArea(triangleAdded[i])
I hope this helps.
BestHugo
HugoKeymasterI see you are curious about plugins developed by @bmarques and his team!
I do not know it personnally, but we could try to make them both compatible with OpenCV 3.2 or even OpenCV 4.2, but I am completely ignorant about the inside of these plugins.
@bmarques do you think it would be easily doable? do you have some spare time for us (since you’re off do not hesitate to say no!)
@nhnhan @newbie I could try to help me with some errors you get.Best wishes,
Hugo
HugoKeymasterHey @pasquale94
I do not know well the examples of SoftRobot. It seems you would need an example displaying how to use the PointCloudProcessing, right ? If so, the best would be to open a new issue on their GitHub asking for such an example.
Best,
Hugo
-
AuthorPosts