Forum Replies Created
-
AuthorPosts
-
31 July 2018 at 17:35 in reply to: [SOLVED] no "createScene" nor "createSceneAndController" module method found error #11616HugoKeymaster
HI Zahra,
I was referring to the scn2python script to apply on the caduceus.scn file in order to get the caduceusPython.py
BestHugo
HugoKeymasterPerfect @skywaver !
I am really glad to see that SOFA & Erik’s work do satisfy you!
I always stay at your disposal.Best regards,
Hugo
HugoKeymasterHi @skywaver,
Unfortunately, there is no existing C++ VR example with SOFA.
It would be awesome if you would make the first one!
For multithreading, Erik did recently improvement on the SOFA plugin, this could help in case of performance issue.Best,
Hugo
26 July 2018 at 14:12 in reply to: [SOLVED] no "createScene" nor "createSceneAndController" module method found error #11535HugoKeymasterHi Zahra, Hi Noura,
Noura is correct it was a html/markdown format issue. It is fixed. Thanks for noticing us.
Regarding the script, again Noura is correct.
Why not simply run the script and then runrunSofa caduceusPython.py
This should run fine.Best
Hugo
26 July 2018 at 14:12 in reply to: [SOLVED] Building CUDA plugin of SOFA v18.06 using VS2017 and cuda_9.2.148_win10 #11534HugoKeymasterHi @suwan,
I am using CUDA on Linux, and I never experienced such an error of nvcc with the SofaCUDA plugin. However, it seems that others are facing this NVCC / CMake issues:
Let me know if this helps.
Hugo
HugoKeymasterHi Zahra,
Imposing both displacement and velocity sounds redundant to me since both state variable are linked through the integration scheme
e.g. Euler explicit: v(t) = ( x(t+dt)-x(t) ) / dt
I am sorry I am having hard time to understand the simulation you want to achieve.
What simulation do you actually intend to do ? what objects do you want to model ?To discover all possible functions with Python, you can have a look at
or in applications/SofaPython at
- the pdf documentation /doc/SofaPython.pdf,
- the template script EmptyController.py
I hope this helps.
Best wishes,Hugo
HugoKeymasterHi @strandhaus,
I am not sure to get what you want to achieve. You want to constraint one point of your cube to a rigid object that can move, is this correct?
If so, I modified the scene here:
<?xml version="1.0" ?> <Node name="root" dt="0.05" showBoundingTree="0" gravity="0 0 -1" bbox="-3 -3 -3 3 3 3"> <RequiredPlugin name="SofaMiscCollision"/> <VisualStyle displayFlags="showBehaviorModels hideForceFields hideCollisionModels showVisual"/> <CollisionPipeline verbose="0" name="CollisionPipeline"/> <BruteForceDetection name="N2"/> <CollisionResponse response="default" name="collision response"/> <MinProximityIntersection alarmDistance="0.001" contactDistance="0.00001"/> <EulerImplicitSolver /> <CGLinearSolver iterations="50" tolerance="1e-06" threshold="1e-06"/> <Node name="RigidParticle" > <MechanicalObject name="particle" template="Rigid" position="0.5 0.5 0.5 0 0 0 1" showObject="1" showObjectScale="0.5"/> <Node name="mappingVec" > <MechanicalObject name="particleVec" template="Vec3d"/> <RigidMapping input="@../particle" output="@particleVec"/> </Node> </Node> <Node name="Cube" > <MechanicalObject name="mo_surface_cube"/> <UniformMass mass="1" /> <RegularGrid nx="2" ny="2" nz="2" xmin="-0.5" xmax="0.5" ymin="-0.5" ymax="0.5" zmin="-0.5" zmax="0.5" /> <TetrahedronFEMForceField name="FEM" youngModulus="4000" poissonRatio="0.3" /> <Node name="Visual" activated="1"> <OglModel name="VisualModel" filename="cube.obj" color="yellow"/> <BarycentricMapping input="@.." output="@VisualModel"/> </Node> </Node> <AttachConstraint object1="@RigidParticle/mappingVec/particleVec" indices1="0" object2="@Cube/mo_surface_cube" indices2="7" constraintFactor="2" twoWay="true" radius="0.1"/> </Node>
Otherwise, never hesitate to take a look at the examples/ folder in the sources of SOFA. You can find for instance : examples/Components/constraint/ (SlidingConstraint, FixedConstraint, PartialFixedConstraint etc)
Best,
Hugo
HugoKeymasterHi @skywaver,
Sorry about the delay, summer is a bit calmer on the forum and we are kept busy on the dev. SOFA Framework does not include (in the open-source part) VR support. However, several work has been done to include SOFA into platform supporting VR like Unity3D.
As you know, Erik Pernod one of the independent developer of SOFA already made some progress on this topic: https://www.youtube.com/watch?v=w89t7Z6sG6g
And he is currently working a lot on performances.Best wishes,
Hugo
HugoKeymasterHi @chcaouette
I never used the JointSpringFF. What I can tell is that if you want to define rest_position and rotation of your DOFs, the best is to specify them in the rest_position=”x y z qw qx qy qz”. Moreover, in the code it is noted that the REST_R corresponds to the offset orientation of the spring.
Does this fit what you want to do?
Hugo
HugoKeymasterHi @skynaver
This is great to see that you’re getting in with SOFACuda!!
1) to use the maximum performance of the GPU:
– First of all you need a powerful GPU card! What is the one you are using?
– To benefit of a great acceleration, the amount of parallelizable tasks must be very high, i.e. the number of DOFs of your object must be high enough. Otherwise, the interest of parallelization won’t be notice, i.e. the cost of copy between CPU and GPU might be to high compared to the computation itself.
– Finally, the GPU implementation of all components in the scene (Mass, ForceField, Solver ..) must be as optimized as possible.I have not SofaCUDA compiled on my current laptop, I will have a look when I get back to my office. Does anyone has additional advices/infos ?
2) about cutting on GPU, I am not sure it has already been widely investigated in SOFA. You might not be able to find built-in examples. However, this is possible to implement. The memory sharing between CPU and GPU must be carefully done since topology information changes at runtime.
Never hesitate to ask support, we are happy to assist you in your work!
Best wishes,Hugo
HugoKeymasterDear Zahra,
We could definitely work on a short video tutorial to make the first steps with SOFA Python. Let me give you some entry points:
- first, you can transform a .scn or .xml file into a python script by using the script scn2python.py available in applications/plugins/SofaPython/. This will ease significantly the transition and see how to write python script
- you can also have a look at all SofaPython-plugin examples, especially the EmptyController.py
I hope this helps. Do not hesitate if you have further questions.
Best regards,Hugo
HugoKeymasterthe force datafield gathers all forces applied for each time step. The value of the vector is cleared at each new time step.
BestHugo
HugoKeymasterHi @chcaouette
Regarding your scene, the issue comes from the fact that each rigid position is solved independently with its own solver. Without any constraint or mapping linking the rigids, they won’t affect each other and therefore won’t move.
What you can do is to you one single solver for all rigid dof:
<?xml version="1.0"?> <Node name="root" dt="0.01" gravity="0 0 -9.81"> <VisualStyle displayFlags="showForceFields showBehaviorModels showVisual showInteractionForceFields" /> <DefaultAnimationLoop/> <EulerImplicitSolver /> <CGLinearSolver /> <!-- Vertèbre T1 --> <Node name="T1" > <MechanicalObject name="vertT1" template="Rigid" position="-46.730 13.813 594.049 0.1264 -0.1761 0.0215 0.9760" /> <!-- Application d’une force --> <ConstantForceField name="forceT1" indices="0" forces="5 0 0 0 0 0" showColor="1 0 1 1" arrowSizeCoef="1.0" /> <!-- <LinearForceField points="0" forces="5 0 0 0 0 0 1 " /> --> <!-- Export des positions et des forces --> <WriteState name="StateT1" filename="positionsT1.data" writeX="1" writeF="1" DOFsX="0" /> </Node> <!-- Vertèbre T2 --> <Node name="T2" > <MechanicalObject name="vertT2" template="Rigid" position="-54.695 10.630 578.688 -0.1270 0.1552 0.0380 0.9789" /> <!-- Export des positions et des forces --> <WriteState name="StateT2" filename="positionsT2.data" writeX="1" writeF="1" DOFsX="0" /> </Node> <!-- Vertèbre T3 --> <Node name="T3" > <MechanicalObject name="vertT3" template="Rigid" position="-60.588 3.019 560.031 -0.2165 0.1218 0.0763 0.9656" /> <!-- Fixation de la vertèbre --> <FixedConstraint template="Rigid" name="fixedVertebra" /> <!-- Export des positions et des forces --> <WriteState name="StateT3" filename="positionsT3.data" writeX="1" writeF="1" DOFsX="0" /> </Node> <!-- Disques IVs --> <JointSpringForceField template="Rigid3d" name="T1-T2" object1="@T1/vertT1" object2="@T2/vertT2" spring="BEGIN_SPRING 0 0 FREE_AXIS 1 1 1 1 1 1 KS_T 500 5000 KS_R 500 5000 REST_T -7.9650 -3.1830 -15.3610 REST_R -0.25771 0.316322 0.0132941 0.912828 END_SPRING "/> <JointSpringForceField template="Rigid3d" name="T2-T3" object1="@T2/vertT2" object2="@T3/vertT3" spring="BEGIN_SPRING 0 0 FREE_AXIS 1 1 1 1 1 1 KS_T 500 5000 KS_R 500 5000 REST_T 5.8930 7.6110 18.6570 REST_R -0.0820912 -0.0291694 0.0561321 0.994571 END_SPRING "/> </Node>
Moreover, there is maybe other alternative for the modeling, like the ArticulatedSystemMapping.scn available in examples/Components/mapping folder.
Cheers,
Hugo
27 June 2018 at 18:05 in reply to: [SOLVED] Collision problems in grasping using Phantom omni #11244HugoKeymasterDear Bek,
Could you share the scene it would help testing it?
Otherwise, you should strongly get involved from /data/Softwares/sofa/src/master/applications/plugins/Geomagic/scenes/Geomagic-FEMLiver.scn but I guess you already did.Hugo
HugoKeymasterIf I am correct, the include
#include <SofaSimulationCommon/common.h>
is obsolete and not needed.HugoKeymasterHi @dufrene
First thank you for your interest in SOFA and welcome to our open free forum!
The problem you encounter is a well known problem, not related to SOFA.It is actually due to Boost and CMake that have incompatibilities with some versions. The version of CMake 3.11 is especially known to have issues with its FindBoost function. We would therefore recommend to decrease your version of CMake to 3.9.
Let us know about your progress.
BestHugo
HugoKeymasterYou have a field “force” in the MechanicalObject summing all forces applied on your object. This can be a state vector to investigate to detect the forces applied on it.
Let me know if you solved your issue.Best,
Hugo
27 June 2018 at 17:33 in reply to: [SOLVED] What is the best way to perform 2D FEM with SOFA? #11240HugoKeymasterHi @mjbarrow,
great to hear that you found happiness in the SOFA examples!
I therefore close the topic.
Best,Hugo
25 June 2018 at 15:57 in reply to: [SOLVED] Need (very) old version of SOFA to use "Flexible" plugin. #11236HugoKeymasterHi Michael
I am really sorry, since I am not using Flexible myself, it is somehow complicated for me to support on this open SOFA plugin. Is there a specific scene you would like to make work?
Hugo
HugoKeymasterDear @suhas1998
Indeed everything is in the documentation: https://www.sofa-framework.org/community/doc/getting-started/run-sofa/#load-and-run-a-specific-scene
Run the SOFA executable “runSofa path_to_the_scn_file”
Could you tell us what is your background exactly? A training session might be the most efficient way to start.Hugo
HugoKeymasterDear @leejuhyun,
Thank you for your interest in our open-source framework and welcome to the SOFA forum!
Research teams (Mimesis team or Rezayi Research Center) and companies in the community have a lot in experience in this. The video you are displaying comes from a product developed by a former spin-off company of ours : InSimo. Therefore, details of their product can not be published.The asset SOFA-Unity3d that you mentioned does support all features from the public version of SOFA (master branch).
Does this answer your questions?Best wishes,
Hugo
HugoKeymasterDear @barryalen1992
As starting points, I would advise to consider:
- the online documentation providing the main principles of SOFA, information about components and explanation about how to start coding in SOFA
- a reference paper to understand the basis of physics of SOFA
- the online API description
- tutorials are available to launch with runSofa : see all scenes in the examples/ repository
To get involved in the SOFA project, the associated page on the SOFA website provides many useful information about
- how to ask help,
- how to report bugs,
- how to contribute,
- how to chat with the community
Moreover, if you are interested in really getting deep into the physics engine, I would be glad to propose you a dedicated training on SOFA. Such a service can also be made on-site if needed.
Eventually, if your institution has interest in SOFA and is willing to support the open-source project, let me know I would be pleased to provide you all details. SOFA really needs the support of all its users and developers.
Best regards,
Hugo
24 June 2018 at 21:38 in reply to: [SOLVED] ExternalPlugin BeamAdapter: Example/Tutorials/3instruments_collis1.scn crashing #11228HugoKeymasterDear @casaad,
You are actually here asking a question regarding a private plugin.
The SOFA forum is dedicated on questions regarding the open-source version of SOFA.Contact me directly, I will provide you a dedicated support regarding your questions.
Sorry not to help here.
Best,Hugo
24 June 2018 at 21:36 in reply to: [SOLVED] Need (very) old version of SOFA to use "Flexible" plugin. #11225HugoKeymasterDear @mjbarrow,
Older versions of SOFA are available as both sources and binaries.
To get an old version of the sources, all you need to do is to checkout the proper branch corresponding the version of SOFA you need. E.g.: git clone -b vXX.XX https://github.com/sofa-framework/sofa.git sofa/v17.12/src/ replacing vXX.XX by the exact version like v16.08
To get an old version of the binaries, you can get them directly from GitHub : https://github.com/sofa-framework/sofa/releasesFlexible should be compatible with 2015 and even 2016 version of SOFA.
An even better version would be that you update the Flexible plugin, if you are using and needing it. Your assistance would be much appreciated.
Best regards,
Hugo
HugoKeymasterHi,
Thank you very much for your interest in our open-source library SOFA and more especially in simulation of cutting.
The video you found was the result of a research PhD thesis mixing SOFA and an open-source topology library CGoGN. Unfortunately, since the PhD student defended his thesis, this is not very active anymore. I will gather information and get back to you.
However, you should know that the SOFA API already enable simulation of cutting, unfortunately no example is available for now. We will shortly work on it.
Best,
Hugo
PS: Please avoid opening several topics for the same question on the forum. Thanks
-
AuthorPosts