Forum Replies Created
-
AuthorPosts
-
23 May 2018 at 21:57 in reply to: [SOLVED] Binary release linux libs – libicui18n.so.55 missing #11095HugoKeymaster
Hi @wakko
That’s a pity that it was not promoted earlier in 2013 !! I am sure it can be useful to many people ! For sure it can fit the Marketplace.
Let us know about the update with Guillaume’s input. If it solves your issue and the rebuild is successful, then I immediately add this on the Marketplace. Does this suit you?
Your project has to benefit from a deserved visibility!
BestHugo
HugoKeymasterDear @bgarcial
Indeed things have been moving in the past, and will move one last time in the future. We know it’s annoying, especially for includes as you are mentioning. But this is done to make SOFA evolve towards a cleaner, standard and more understandable structure. We are currently working on it.
For now, we have a page describing the API of the open-source codes. This should definitely help you in your work. However, I don’t know this class in SOFA:
PointSubset.h
. Are you sure it does exist?Best,
Hugo
HugoKeymasterHi @zahra,
you are perfectly right, there should be a warning when activating the Modeler project.
I added the following PR to add this.Note that we are planning to build a new Modeler, all we need is to find enough time and resources to do it!
Best,
Hugo
23 May 2018 at 17:30 in reply to: [SOLVED] Binary release linux libs – libicui18n.so.55 missing #11082HugoKeymasterDear @wakko
That’s awesome to see such an advanced project based on SOFA! We are always glad to discover more achievements! Congratulations for your QTetramesher project!
Note that since it’s all open-source, we would be glad to add it on the SOFA Marketplace. Is this fine for you?
Regarding the linking problem, engineers are already on it! We should be able to get back to you soon.
Best,
Hugo
HugoKeymasterHi Noura,
Sorry for the delay, I dug a bit to see if any paper was mentioning the open-source code and theory for hyperelasticity. The papers I found were mainly referring to the a discretization method, the Multiplicative Jacobian Energy Decomposition (MJED) which is an alternative to the classical Galerkin FEM (Finite Element Method) formulation.
You can get inspired from usual theoretical books.
Sorry not to help more. In case you write anything, it would be nice to improve the associated documentation, keep us updated!Best,
Hugo
HugoKeymasterHey @secretdevil
Any feedback regarding Fred’s comment ?
23 May 2018 at 16:02 in reply to: [SOLVED] Get the position value from a MechanicalObject point in Python #11079HugoKeymasterHi Quentin,
Does it work for you now @quentinfrancois0 ?
HugoKeymasterGreat!
Keep us updated about your progress!Cheers
Hugo
18 May 2018 at 18:48 in reply to: [SOLVED] Get the position value from a MechanicalObject point in Python #11066HugoKeymasterHi Quentin,
This is indeed a solution.
Another solution is to sort the point that you want to track at the beginning of the simulation. Once you selected them and saved their IDs in the Python script you can read them in the same way.Best
Hugo
18 May 2018 at 17:49 in reply to: [SOLVED] Get the position value from a MechanicalObject point in Python #11062HugoKeymasterthanks for your question!
I will answer you through an example. I wrote a scene and a Python script below doing what you expect.First the scene is very basic and just call a Python script (which makes the scene initialization):
<Node name="root" dt="0.01" > <RequiredPlugin name='SofaPython'/> <PythonScriptController filename="pythonController.py" classname="PrintPosition" listening="1"/> </Node>
then the script creates the scene and access the data during the simulation:
# require sofa to run import Sofa # use os library to take the path to the mesh folder import os class PrintPosition(Sofa.PythonScriptController): #called once the script is loaded def createGraph(self,rootNode): self.rootNode = rootNode self.dotNode = rootNode.createChild('dot') self.dotNode.createObject('EulerImplicit', firstOrder='0', rayleighStiffness="0.2", rayleighMass="0.2") self.dotNode.createObject('CGLinearSolver', iterations='100', tolerance='1e-9', threshold='1e-9') self.dotNode.createObject('MeshVTKLoader', name='loader', filename='/data/Softwares/sofa/src/master/forum/zygote-demo/data/large-intestin.vtu') self.dotNode.createObject('TetrahedronSetTopologyContainer', src='@loader', name='container') self.dotNode.createObject('MechanicalObject', name='myMechanicalObject', template='Vec3d', showObject='1') self.dotNode.createObject('TetrahedronSetTopologyModifier') self.dotNode.createObject('TetrahedronSetTopologyAlgorithms', template='Vec3d') self.dotNode.createObject('TetrahedronSetGeometryAlgorithms', template='Vec3d') self.dotNode.createObject('UniformMass', totalmass='10') self.dotNode.createObject('TetrahedronFEMForceField', template='Vec3d', name='FEM', method='large', poissonRatio='3000', youngModulus='0.5e-3') self.dotNode.createObject('OglModel') # create pointer towards the MechanicalObject self.myMechanicalObjectPointer = self.dotNode.getObject('myMechanicalObject') return 0; #called on each animation step def onBeginAnimationStep(self, dt): #do whatever you want at the beginning of the step t = self.rootNode.findData('time').value return 0; #called on each animation step def onEndAnimationStep(self, dt): #access the 'position' state vector myMOpositions = self.myMechanicalObjectPointer.findData('position').value # print the first value of the DOF 0 (Vec3 : x,y,z) x[0] y[0] z[0] print str(myMOpositions[0][0])+' '+str(myMOpositions[0][1])+' '+str(myMOpositions[0][2]) return 0;
The important part of the script focus on the MechanicalObject (“myMechanicalObject”), you create a pointer towards it in the initGraph() function (“myMechanicalObjectPointer”).
Then, during the simulation (at the end of each step in the onEndAnimationStep() function), you can recover the values of your DOFs (here the position Vec3d of your object).Note that you can also modify on the fly a data, e.g. modify the elasticity:
self.dotNode.getObject('FEM').findData('youngModulus').value = 0.2
Do this help you?
HugoKeymasterHugoKeymasterHi @meldiwiny
Since the PR#524 (also in the v17.12 release), a warning is sent when the BBox is invalid.
In such a case, make sure that the BBox is well computed in your scene:
- by adding a OglModel for the visualization if you have one
- by adding the option showObject=”1″ to your MechanicalObject
- or specifying directly in one of your nodes the bbox=”0 0 0 1 1 1″ for instance
Moreover, make sure that your scn.view file (same location as the scene) also has correct values. You might have saved invalid camera settings breaking the visualization.
In your case, there is a typography in you code, a missing commar before bbox:
rootNode.createObject('VisualStyle', displayFlags='showVisualModels showBehaviorModels showCollisionModels hideBoundingCollisionModels showForceFields showInteractionForceFields hideWireframe', bbox='0 0 0 1 1 1')
the bbox is therefore not taken into account.
Let me know if this is correct.Best,
Hugo
HugoKeymasterThx Marwa, I copy paste here:
import Sofa from math import sin,cos #path = os.path.dirname(os.path.abspath(__file__))+'/' #One of the problem is the dimensions ############################## stiffness Test ############################################# def createScene(rootNode): rootNode.createObject('RequiredPlugin', name='SoftRobots') rootNode.createObject('RequiredPlugin', name='BeamAdapter') rootNode.createObject('RequiredPlugin', name='SofaPython') rootNode.createObject('VisualStyle', displayFlags='showVisualModels showBehaviorModels showCollisionModels hideBoundingCollisionModels showForceFields showInteractionForceFields hideWireframe' bbox='0 0 0 1 1 1') rootNode.findData('dt').value= 0.01 rootNode.findData('gravity').value= '0 9.8 0' rootNode.createObject('BackgroundSetting', color='0 0.168627 0.211765') rootNode.createObject('OglSceneFrame', style="Arrows", alignment="TopRight") rootNode.createObject('PythonScriptController', classname="controller", filename="test2.py") smawormNode = rootNode.createChild('SMAWorm') smawormNode.createObject('EulerImplicit') smawormNode.createObject('SparseLDLSolver') length = 10.716 nbEdges =10 edgesList = "" for i in range(0,nbEdges): edgesList += str(i)+ " " + str(i+1) + " " positionsList = "" for i in range(0,nbEdges+1): dx = length/(nbEdges+1) positionsList += str(dx*i)+ " 0 0 0 0 0 1 " smawormNode.createObject('Mesh', edges=edgesList) smawormNode.createObject('MechanicalObject', template='Rigid', position=positionsList, name='Frame') smawormNode.createObject('BeamInterpolation') smawormNode.createObject('RestShapeSpringsForceField', name="MeasurementFF", points="0" , stiffness="100000e100", recompute_indices="1", angularStiffness="100000e100" , drawSpring="1" , springColor="1 0 0 1") ################################## It doesnot make a big change in the system as it is dielectric layer and there is no big change in the displacement behavior, the displacement still in the same range speNode = smawormNode.createChild('SPE') speNode.createObject('Mesh', edges=edgesList) speNode.createObject('BeamInterpolation', name='Interpol', crossSectionShape='rectangular', lengthY='2.167', lengthZ='0.2', defaultYoungModulus='0.8e6') #### the change of SPE layer young Modulus it doesnot make a difference as it is dielectric material. speNode.createObject('AdaptiveBeamForceFieldAndMass', name="BeamForceField", computeMass="1", massDensity="0.0016") DOF0TransformNode = "" for i in range(0,nbEdges+1): DOF0TransformNode += " 0 0 0.1 0 0 0 1 " cp_upNode = smawormNode.createChild('CP_up') cp_upNode.createObject('Mesh', edges=edgesList) cp_upNode.createObject('BeamInterpolation', name='Interpol', crossSectionShape='rectangular', lengthY='2.167', lengthZ='0.025', defaultYoungModulus='0.1e9', dofsAndBeamsAligned='0', DOF0TransformNode0=DOF0TransformNode, DOF1TransformNode1=DOF0TransformNode) cp_upNode.createObject('AdaptiveBeamForceFieldAndMass', name="BeamForceField", computeMass="1", massDensity="0.0016") DOF0TransformNode = "" for i in range(0,nbEdges+1): DOF0TransformNode += " 0 0 -0.1 0 0 0 1 " cp_downNode=smawormNode.createChild('CP_down') cp_downNode.createObject('Mesh', edges=edgesList) cp_downNode.createObject('BeamInterpolation', name='Interpol', crossSectionShape='rectangular', lengthY='2.167', lengthZ='0.025', defaultYoungModulus='0.1e9', dofsAndBeamsAligned='0', DOF0TransformNode0=DOF0TransformNode, DOF1TransformNode1=DOF0TransformNode) cp_downNode.createObject('AdaptiveBeamForceFieldAndMass', name="BeamForceField", computeMass="1", massDensity="0.0016") #Mapping Point= smawormNode.createChild('SMAPoint') Point.createObject('MechanicalObject', position='5.2 0 0', name='location') Point.createObject('ConstantForceField',name='SMAForce', points= "0", forces='0 0 800', arrowSizeCoef="0.001") Point.createObject('AdaptiveBeamMapping', name="222000000") visuNode = smawormNode.createChild('visualization') visuNode.createObject('RegularGridTopology', name='topology', n="10 4 2" , min="0 -0.3 -0.05", max="10.716 0.5 0.05") visuNode.createObject('MechanicalObject', name='test', src='@topology') visuNode.createObject('AdaptiveBeamMapping', interpolation="@../SPE/Interpol", input="@../Frame", output="@test") oglNode = visuNode.createChild('ogl') oglNode.createObject('OglModel', name='visualModel', color='0 1 0 1') oglNode.createObject('IdentityMapping') visuNode2 = smawormNode.createChild('visualization2') visuNode2.createObject('RegularGridTopology', name='topology', n="10 4 2" , min="0 -0.3 -0.05", max="10.716 0.5 0.05") visuNode2.createObject('MechanicalObject', name='test', src='@topology') visuNode2.createObject('AdaptiveBeamMapping', interpolation="@../CP_up/Interpol", input="@../Frame", output="@test") oglNode2 = visuNode2.createChild('ogl') oglNode2.createObject('OglModel', name='visualModel', color='1 0 0 1') oglNode2.createObject('IdentityMapping') visuNode3 = smawormNode.createChild('visualization3') visuNode3.createObject('RegularGridTopology', name='topology', n="10 4 2" , min="0 -0.3 -0.05", max="10.716 0.5 0.05") visuNode3.createObject('MechanicalObject', name='test', src='@topology') visuNode3.createObject('AdaptiveBeamMapping', interpolation="@../CP_down/Interpol", input="@../Frame", output="@test") oglNode3 = visuNode3.createChild('ogl') oglNode3.createObject('OglModel', name='visualModel', color='1 0 0 1') oglNode3.createObject('IdentityMapping')
HugoKeymasterHi @meldiwiny,
could you please post your file? I am sure we will find shortly the solution.
Best,
HugoHugoKeymasterHi Marwa,
Could you provide us your scene file? I suspect an issue in it.
Thanks !
HugoKeymasterHi Zahra !
Great to hear from you, I need a bit more details here.
– Could you detail us the folder architecture ? (src repo, build repo)
– What are all the commands you already ran ?– Did you configure successfully the project (run the command from the BUILD_DIR: cmake-gui PATH_TO_SRC_DIR)
Best,
Hugo
HugoKeymasterHi @bgarcial,
That’s great to hear from you and to see you progressing with your ZMQ/SerialCommunication work. My apologies for not being able to help you more. Keep us updated about the integration into one unique plugin.
Best,
Hugo
HugoKeymasterCool thanks for the feedback Eleonora!
Cheers,Hugo
HugoKeymasterDear @montsediaz
The hollow STL geometry that you want to mesh with volumetric elements (tetra) has very thin walls. Therefore, you mesh will require very small elements to match accurately your geometry.
I would recommend to use a surface mesh for the mechanics with a shell approach.Best regards,
Hugo
27 April 2018 at 15:53 in reply to: add_executable cannot create target, another target with the same namea exist. #10843HugoKeymasterSorry for the delay of reply @baymin !!
Regarding the online documentation, you can update yourself when you find any issue/incorrect info. The documentation is Markdown files versioned on a Git repo :
https://github.com/sofa-framework/doc
Anyone can contribute (pull-request) !Your main issue is that you try to access a GNode line 17 of your Main.cpp which is protected. You can get inspired of the Main.cpp of the runSofa project in “sofa/applications/projects”“.
I hope this helps.
Best regards,Hugo
HugoKeymasterhey @eleonora !
Do you still have the issue?
Could you have some clue for us to help you?Thanks for reporting! that’s great!
Best,Hugo
HugoKeymasterDear @metheme,
Did all these nice advices help you?
I would be glad to get a live demo/video of your cutting simulation on Youtube 😉Cheers,
Hugo
HugoKeymasterDear @yxp233,
Thank you for your interest in our open-source library SOFA.
You can find all recommended versions on the “Build” pages of the online documentation.For Windows in your case, you can find it here: Build for Windows
If it fits your needs you can close this topic.
Best regards,Hugo
HugoKeymasterDear SOFA devs,
Our community is still actively hiring!
Check it out on our Jobs webpage, you can still find several (new!) open positions in the SOFA community : in Rennes, Strasbourg, Bordeaux (France) and worldwide (Ireland, Canada, Korea etc.)!Do not hesitate to contact us for more details.
Hugo Talbot
HugoKeymasterHi @vaccum09
Have you properly followed the instructions for Windows?
You are using the v17.12 source release, right ?
Hugo
-
AuthorPosts