Forum Replies Created
-
AuthorPosts
-
HugoKeymaster
Hi @hkomninos,
how did you solve your issue? what was the problem?
Regarding the PrecomputedConstraintCorrection, you can find some explanation in the updated doc.
I think the paper entitled “GPU-based real-time soft tissue deformation with cutting and haptic feedback” used it.
Best,
Hugo
12 October 2018 at 12:24 in reply to: Rotation problem with AffineMovementConstraint and BeamFEMForceField #12174HugoKeymasterThank you very much for you notice and for daring taking a look into the c++ code!
That’s brave and that’s a good reflex.We noticed this week (on master branch) that some check of unity on the quaternion (for Rigid3Types) disappeared. However, the addition instead of multiplication might be an error. I need to check this part.
Thanks again for updating us: I created an issue to follow the prob here.
Best
Hugo
HugoKeymasterHi @hkomninos,
it appears that you are having an issue due to an wrong access in memory (un-initialized vector, or pointer). The creation of the FreeMotionAnimationLoop should not be an issue in cpp. Could you share with us you cpp scene ?
Best
Hugo
10 October 2018 at 15:23 in reply to: [SOLVED] Linking GeomagicDevice.position with MechanicalObject3d.position in cpp #12139HugoKeymasterHi @hkomninos
Please do not double post your questions
Your question has already been submitted in the post : #12090 about the Geomagic plugin. It will be answered there. Thank you.
Best,
Hugo
HugoKeymasterHi Noura,
Thanks for your feedback.
The best would be to do your remarks on the GitHub doc so that I can more efficiently update.Regarding the mapping, a dedicated doc page exists here now. Some pages remains at “todo” or “soon” since we would like to go even more into details for each class (of Mapping among others). But this will come a bit later on.
Best
Hugo
HugoKeymasterDon’t be confused.
I close the topic then.If you face the issue again, please just follow my instructions above, by specifying a bbox value to your root node.
Hugo
HugoKeymasterHi Zahra,
There is two possible ways to use SOFA:
- download the sources of SOFA: there you will need to clone (from GitHub using the command
git clone -b v18.06 https://github.com/sofa-framework/sofa.git
, configure (CMake) and compile (with your desired compiler gcc, clang ..) the code. After compilation, you will have an executable runSofa generated. Everything is detailed in the doc - download the binaries: go on the download page, download the package corresponding to your OS and find runSofa in it
Best
Hugo
HugoKeymasterHi @fsharifi135
As a free forum, everyone here replies as fast as possible. However, if you need a specific support, do not hesitate to the SOFA Consortium that can provide you any service you want around SOFA.
For your issue, is there a reason to use the debug build mode?
If not, try first running SOFA in release mode.Best,
Hugo
HugoKeymasterHi Fei
You should read carefully the error messages.
It explains that you can set thebbox="-1 -1 -1 1 1 1"
in the root node to specify the bounding box. Bounding box is usually computed by visual model (OglModel), in this case the bbox is automatically computed. I guess you do not have an OglModel in your scene. That’s why you have this warning.Let me know if this fixes your issue.
BestHugo
5 October 2018 at 15:14 in reply to: How to make some part of an object elastic and other part plastic #12112HugoKeymasterDear @suwan
You should have a look to the TetrahedronFEMForceField which includes elasto-plastic deformation. You can have a look in the Data of this class in the SOFA API.
Best
Hugo
HugoKeymasterYou should have a look to my previous message, applying the same structure to your case will make the cloth controlled by a rigid object.
Best,
Hugi
HugoKeymasterHugoKeymasterHi Eleonora,
I think the starting a common project around SOFA validation (against other solutions and analytical solutions when existing) would be a great idea. We have many interested partners for this.
Best
Hugo
HugoKeymasterDear @fsharifi135
The errors are pretty clear indeed: you need to have a version of SOFA with the metis option activated (flag SOFA_BUILD_METIS), with the plugin SofaPython activated (flag PLUGIN_SOFAPYTHON), with the module SofaSparseSolver activate (flag MODULE_SOFASPARSESOLVER) and your version of Qt appears to be undefined.
You should then rather use and compile the sources of SOFA instead of the binaries.
Best
Hugo
HugoKeymasterHi,
The release of SOFA v18.06 had these small errors appearing, but no worries nothing bad. It has been fixed since then in the master branch of the SOFA sources (see PR#758).
Best
Hugo
3 October 2018 at 20:32 in reply to: [SOLVED] How can I get the index of the tetrahedron which contain a particular point? #12086HugoKeymasterSeveral components do have such a visualization option (MechanicalObject, SparseGrid, MeshTopology etc.). If you don’t find it, please post us your scene.
Hugo
3 October 2018 at 10:01 in reply to: [SOLVED] How can I get the local frames in TetrahedralCorotationalFEMForceField? #12080HugoKeymasterNice to hear Wong,
Could you let us know how you solved your issue?
I close also this topic.Best
Hugo
3 October 2018 at 10:01 in reply to: [SOLVED] How can I get the index of the tetrahedron which contain a particular point? #12079HugoKeymasterHi @outtt
When a topic is solved you can close it yourself.
Note for people facing the same question: you can activate in the Visualization Data of the TetrahedronSetGeometryAlgorithm with showPointIndices, showEdgeIndices etc.
A work is in progress to integrate it in a more easy way into a new GUI for SOFA.
Best regards
Hugo
2 October 2018 at 17:40 in reply to: [SOLVED] the reason to use "TrianglePressureForceField" and "TTriangleModel" #12077HugoKeymasterAlright, I close the topic then.
If you have any further question, as usual, do not hesitate to post it !Hugo
HugoKeymaster
@fsharifi135 : just to make sure you are attempting to compile SOFA with the binary version of SOFA (from the download page of SOFA). Is this correct?If so, you need to download the SoftRobot plugin in a separate repository. Let’s call it “SoftRobotPlugin/src/“.
Then you need to build the plugin by:
– first creating a build/ directory for the plugin like “SoftRobotPlugin/build/”
– run cmake using the src and build directory of the plugin
– configure, generate
– and finally compileLet me know if this helps.
BestHugo
26 September 2018 at 11:46 in reply to: [SOLVED] no "createScene" nor "createSceneAndController" module method found error #12029HugoKeymasterHi Zahra
Indeed I can reproduce the problem.
Just afterimport Sofa
you can add:def createScene(rootNode): rootNode.createObject('RequiredPlugin', name='SofaPython') mySimulation = Ttest(rootNode,[]) return 0;
and define all your scene in the initGraph function instead of the createGraph function.
Resulting in:
""" TtestPython is based on the scene /home/zahra/sofa/Work/test/Ttest.scn but it uses the SofaPython plugin. Further informations on the usage of the plugin can be found in sofa/applications/plugins/SofaPython/doc/SofaPython.pdf To lance the scene, type runSofa /home/zahra/sofa/Work/test/TtestPython.scn The current file has been written by the python script /home/zahra/sofa/Sofa17.06/src/applications/plugins/SofaPython/scn2python.py Author of scn2python.py: Christoph PAULUS, christoph.paulus@inria.fr """ import Sofa def createScene(rootNode): rootNode.createObject('RequiredPlugin', name='SofaPython') mySimulation = Ttest(rootNode,[]) return 0; class Ttest (Sofa.PythonScriptController): def initGraph(self,rootNode): # rootNode rootNode.createObject('DefaultPipeline', name='CollisionPipeline', verbose='0') rootNode.createObject('BruteForceDetection', name='N2') rootNode.createObject('DefaultContactManager', name='collision response', response='default') rootNode.createObject('DiscreteIntersection', name='discreteIntersection1') # rootNode/Liver Liver = rootNode.createChild('Liver') Liver.depend = 'topo dofs' Liver.createObject('EulerImplicitSolver', name='cg_odesolver', printLog='0') Liver.createObject('CGLinearSolver', threshold='1e-09', tolerance='1e-09', name='linear solver', iterations='25', template='GraphScattered') Liver.createObject('MeshGmshLoader', tetrahedraGroups=' -1 0 38144', name='loader', filename='/home/zahra/sofa/Work/testbygmsh/livertetra7509.msh') Liver.createObject('TetrahedronSetTopologyContainer', triangles='@loader.triangles', position='@loader.position', edges='@loader.edges', name='topo', tetrahedra='@loader.tetras') Liver.createObject('MechanicalObject', force='0 0 0', name='dofs', template='Vec3d', position='@loader.position', velocity='0 0 0', externalForce='0 0 0', restScale='1') Liver.createObject('TetrahedronSetGeometryAlgorithms', drawColorEdges='0.4 1 0.298039 1', showIndicesScale='0.01', name='GeomAlgo', showPointIndices='0', template='Vec3d') Liver.createObject('DiagonalMass', massDensity='1', name='computed using mass density', template='Vec3d') Liver.createObject('TetrahedralCorotationalFEMForceField', poissonRatio='0.3', name='FEM', computeGlobalMatrix='0', method='large', template='Vec3d', youngModulus='12000') Liver.createObject('PlaneForceField', name='planeFF0', template='Vec3d', normal='0 1 0') Liver.createObject('ConstantForceField', indices='111', name='constantFF0', template='Vec3d', forces='0 -120 0') Liver.createObject('FixedConstraint', indices='11 17 16 15 14 4 3 0 45 95 42 40 38 39 53 62 61 60 4 63 59 125 24 20 19 9', drawSize='0', name='fixedConstraint0', template='Vec3d') Liver.createObject('MeshExporter', exportEveryNumberOfSteps='1', quads='0', name='meshExporter3', format='gmsh', exportAtEnd='1', filename='/home/zahra/sofa/Work/Exported/Fine/LiverFine_111_0_-120_0', exportAtBegin='1', hexas='0', edges='0', listening='0', triangles='0') Liver.createObject('TetrahedronSetTopologyModifier', name='tetrahedronSetTopologyModifier9') Liver.createObject('TetrahedronSetTopologyAlgorithms', name='tetrahedronSetTopologyAlgorithms10', template='Vec3d') # rootNode/Liver/Visu-fine Visu_fine = Liver.createChild('Visu-fine') Visu_fine.createObject('OglModel', sfactor='GL_SRC_ALPHA', blendEquation='GL_FUNC_ADD', name='oglModel0', template='ExtVec3f', dfactor='GL_ONE_MINUS_SRC_ALPHA', material='Default Diffuse 1 0.666667 0 0 1 Ambient 1 0.2 0.2 0.2 1 Specular 0 1 1 1 1 Emissive 0 0 0 0 0 Shininess 0 45 ', primitiveType='DEFAULT') Visu_fine.createObject('IdentityMapping', input='@../', name='identityMap1', template='Vec3d,ExtVec3f', output='@./') # rootNode/Liver/coarse coarse = Liver.createChild('coarse') coarse.createObject('MeshGmshLoader', tetrahedraGroups=' -1 0 596', name='meshGmshLoader1', filename='/home/zahra/sofa/Work/testbygmsh/livertetra181.gmsh') coarse.createObject('TetrahedronSetTopologyContainer', triangles='@meshGmshLoader1.triangles', position='@meshGmshLoader1.position', edges='@meshGmshLoader1.edges', name='tetrahedronSetTopologyContainer2', tetrahedra='@meshGmshLoader1.tetras') coarse.createObject('MechanicalObject', force='0 0 0', name='mObject0', template='Vec3d', position='@meshGmshLoader1.position', velocity='0 0 0', externalForce='0 0 0', restScale='1') coarse.createObject('TetrahedronSetTopologyModifier', name='tetrahedronSetTopologyModifier3') coarse.createObject('TetrahedronSetGeometryAlgorithms', drawColorEdges='0.4 1 0.298039 1', recomputeTrianglesOrientation='0', name='tetrahedronSetGeometryAlgorithms0', showPointIndices='1', flipNormals='1', showIndicesScale='0.01', template='Vec3d') coarse.createObject('TetrahedronSetTopologyAlgorithms', name='tetrahedronSetTopologyAlgorithms1', template='Vec3d') coarse.createObject('MeshExporter', exportEveryNumberOfSteps='1', quads='0', name='meshExporter13', format='gmsh', exportAtEnd='1', filename='/home/zahra/sofa/Work/Exported/Coarse/LiverCoarse_111_0_-120_0', exportAtBegin='1', hexas='0', edges='0', listening='0', triangles='0') coarse.createObject('EulerImplicitSolver', name='eulerImplicitSolver0') coarse.createObject('CGLinearSolver', name='cGLinearSolver1', template='GraphScattered') coarse.createObject('DiagonalMass', name='diagonalMass2', template='Vec3d') coarse.createObject('FixedConstraint', indices='0', name='fixedConstraint3', template='Vec3d') coarse.createObject('PlaneForceField', name='planeFF4', template='Vec3d', normal='0 1 0') coarse.createObject('TetrahedralCorotationalFEMForceField', youngModulus='12000', name='tetrahedralCorotationalFEMFF5', poissonRatio='0.3', template='Vec3d') # rootNode/Liver/coarse/Visu-coarse Visu_coarse = coarse.createChild('Visu-coarse') Visu_coarse.createObject('OglModel', sfactor='GL_SRC_ALPHA', name='oglModel1', material='Default Diffuse 1 0 0 1 1 Ambient 1 0 0 0.2 1 Specular 0 0 0 1 1 Emissive 0 0 0 1 1 Shininess 0 45 ', primitiveType='DEFAULT', template='ExtVec3f', translation='0 0 0', dfactor='GL_ONE_MINUS_SRC_ALPHA', blendEquation='GL_FUNC_ADD') Visu_coarse.createObject('IdentityMapping', input='@../', name='identityMap2', template='Vec3d,ExtVec3f', output='@./') return 0; def onKeyPressed(self, c): return 0; def onKeyReleased(self, c): return 0; def onLoaded(self, node): return 0; def onMouseButtonLeft(self, mouseX,mouseY,isPressed): return 0; def onMouseButtonRight(self, mouseX,mouseY,isPressed): return 0; def onMouseButtonMiddle(self, mouseX,mouseY,isPressed): return 0; def onMouseWheel(self, mouseX,mouseY,wheelDelta): return 0; def onGUIEvent(self, strControlID,valueName,strValue): return 0; def onBeginAnimationStep(self, deltaTime): return 0; def onEndAnimationStep(self, deltaTime): return 0; def onScriptEvent(self, senderNode, eventName,data): return 0; def bwdInitGraph(self, node): return 0; def storeResetState(self): return 0; def reset(self): return 0; def cleanup(self): return 0;
Best
Hugo
HugoKeymasterIt’s merged in SOFA master branch.
BestHugo
26 September 2018 at 11:22 in reply to: [SOLVED] Load msh and vtk file in XML and read with sofa #12027HugoKeymasterYou can have a look to the examples in examples/Components/loader/MeshVTKLoader.scn
If it doesn’t help, could you post your error?Best,
Hugo
HugoKeymasterHi Harris,
As Erik wrote you privately, it might be related to a current issue with the Geomagic plugin. A PR will be done within the week. Stay tuned, you’ll be able to test the fix very soon.
Cheers
Hugo
HugoKeymasterHi Harris
You mean that you add in the simulation created in runSofa, new components like the GeomagicDriver?
And what do you mean exactly by “I did the same for the SofaCarving and I did not had a problem”. Could you show the corresponding lines of code?
Instead of overwriting runSofa, I would rather advise you later to create your own plugin/applications separately from SOFA. See the doc.
Cheers
Hugo
- download the sources of SOFA: there you will need to clone (from GitHub using the command
-
AuthorPosts