Forum Replies Created
-
AuthorPosts
-
SimonMember
I could think off 2 .pyscn files:
1st .pyscn
-create part of my scne with the roi
-initialize it
-animate for on time step
-get my indices, save them somehow2nd .pyscn
-import indices somehow
-continue/finish my createscene processOr is there already some more clever approach to this?
SimonMemberThanks @Hugo,
I understand. But if I need the the list of indices in the creation of my scene how can I do this?
Is there something possible like:
– createScene() (until I need initialization)
– initialize()
– continue with createScene() ?31 March 2020 at 18:31 in reply to: [SOLVED] How to import numpy in python scripting of SOFA? #15610SimonMember30 March 2020 at 14:46 in reply to: [SOLVED] How to import numpy in python scripting of SOFA? #15583SimonMemberHi @jnbrunet,
thanks for the fast reply, in the meantime I have installed python 2.7 and pip installed numpy into that.
sys.prefix
is the one I needed to check.Output in the runSofa console window:
[INFO] [SceneCheckerVisitor] Finished validating node “root”.
C:\Python27 C:\Users\swtouch\SOFA\v19.12.00\bin\runSofa.exe ['', 'C:/Users/swtouch/SOFA/v19.12.00/plugins/SofaPython/lib/python2.7/site-packages', 'C:\\WINDOWS\\SYSTEM32\\python27.zip', 'C:\\Users\\swtouch\\Anaconda2\\Lib', 'C:\\Users\\swtouch\\Anaconda2\\DLLs', 'C:\\Python27\\Lib', 'C:\\Python27\\DLLs', 'C:\\Python27\\Lib\\lib-tk', 'C:\\Users\\swtouch\\SOFA\\v19.12.00', 'C:\\Users\\swtouch\\SOFA\\v19.12.00\\bin', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages'] [INFO] [SceneCheckerVisitor] Validating node "root" with checks: [SceneCheckAPIChange, SceneCheckDuplicatedName, SceneCheckMissingRequiredPlugin, SceneCheckUsingAlias]
Thanks
Simon30 March 2020 at 11:45 in reply to: [SOLVED] RigidMapping from Rigid3d to only some particles of FEMbody #15581SimonMemberHi @damien-marchaluniv-lille1-fr,
now it is working. I have forgotten to get a python27 + numpy for the DeFrost SOFA version to work.
Now I can progress.
Thanks30 March 2020 at 10:24 in reply to: [SOLVED] How to import numpy in python scripting of SOFA? #15580SimonMemberHi @Zahra,
I am having the same problem as you had. Good to see you have solved that.
– What do you mean by the default python? I have Anaconda2, Anaconda3 and a clean python 2.7, which one is the default? How do I find out?
– How can I find out which python my SOFA is using? I am so far using the precompiled SOFA binaries.
– How to change the default python? Has this something to do with building SOFA or is this some system setting. I am using Windows 10.
Thanks in advance
Simon25 March 2020 at 13:06 in reply to: [SOLVED] RigidMapping from Rigid3d to only some particles of FEMbody #15554SimonMemberI assume what I need to change in my use of TransformEngine is something from that post:
https://www.sofa-framework.org/community/forum/topic/rotation-orientation-of-a-rigid-model/
In my case Rigid at (2,0,0). I have to adopt my .py to get a local rotation, as this is what I want.
Question: The TransformEngine is always a transformation referring to the global reference frame at (0,0,0)?
This is what I assume from the behaviour of:
rigid_frame_rotation.pyscn in:
https://github.com/swunsch/sofa-help/tree/master/05_rotating_beam/quest_transform_engine
25 March 2020 at 10:32 in reply to: [SOLVED] RigidMapping from Rigid3d to only some particles of FEMbody #15553SimonMemberHi @Hugo,
okay cool, can I see your corresponding .pyscn file + .py(for the rotation, if you do so)?
I prepare another question because I’ve come up with something where my problem originates. maybe…
Thank you
25 March 2020 at 08:20 in reply to: [SOLVED] RigidMapping from Rigid3d to only some particles of FEMbody #15548SimonMembermaybe I’ve messed up my TransformEngine I’ll have to check that first…
25 March 2020 at 08:12 in reply to: [SOLVED] RigidMapping from Rigid3d to only some particles of FEMbody #15547SimonMemberHi @Hugo,
aha ok, I understand it is not an error it’s a warning. So what I’ve build so far is the right way for my needs? And the fixedConstraint is not working properly in this case? Or have I done something wrong?
Maybe the TransFormEngine and the Constraint don’t work together well. I’ll try something in this direction, but in general I will need a way to prescribe the rotation of the Rigid3D in a time dependent manner, while its position is fixed.
I can’t see the picture, but I know the behaviour is strange.
Thanks
Simon24 March 2020 at 13:52 in reply to: [SOLVED] RigidMapping from Rigid3d to only some particles of FEMbody #15535SimonMemberHi @Hugo,
again I’ve Problems with the forum, I’ve written a reply but it’s not listed in this post. But I get an E-mail, that Simon has posted a new reply. And in this mail I see my post. So I try again with this reply.
I’ve adopted your suggested MechanicalMatrixMapper.pyscn example to my needs.
See:
https://github.com/swunsch/sofa-help/tree/master/05_rotating_beam/quest_1_2But I don’t get the fixedConstraint to work now. I get the error:
[WARNING] [FixedConstraint(Fix)] Can not find the topology, wont be able to handle topological changes
23 March 2020 at 20:01 in reply to: [SOLVED] RigidMapping from Rigid3d to only some particles of FEMbody #15529SimonMembercould it be the
/
and\
in the path strings?23 March 2020 at 20:00 in reply to: [SOLVED] RigidMapping from Rigid3d to only some particles of FEMbody #15528SimonMembersorry for the delay…
with the precompiled “DeFrost” Version of SOFA I get following erros, when running your example code. The “plugins/SoftRobots/docs/tutorials/FirstSteps” Tutorial however runs with no problem. What could be the problem?
[ERROR] [PythonScript] ImportError: cannot import name _distributor_init File "stlib_example_damien.pyscn", line 8, in createScene from stlib.physics.mixedmaterial import Rigidify File "C:/Users/swtouch/SOFA/SOFA_v19.06.99_custom_Win64_v8.1/plugins/STLIB/python\stlib\physics\mixedmaterial\__init__.py", line 17, in <module> from rigidification import Rigidify File "C:/Users/swtouch/SOFA/SOFA_v19.06.99_custom_Win64_v8.1/plugins/STLIB/python\stlib\physics\mixedmaterial\rigidification.py", line 25, in <module> from splib.numerics import Vec3, Quat, sdiv File "C:/Users/swtouch/SOFA/SOFA_v19.06.99_custom_Win64_v8.1/plugins/STLIB/python\splib\numerics\__init__.py", line 38, in <module> import numpy File "C:\Users\swtouch\Anaconda2\lib\site-packages\numpy\__init__.py", line 140, in <module> from . import _distributor_init
6 March 2020 at 18:37 in reply to: [SOLVED] RigidMapping from Rigid3d to only some particles of FEMbody #153014 March 2020 at 22:32 in reply to: [SOLVED] RigidMapping from Rigid3d to only some particles of FEMbody #15284SimonMemberThanks @Hugo,
it’s going in the right direction. Sadly my earlier have not been posted (somehow the FORUM and me having some digitial issues) but this is not a problem because we have skipped alot of bad scenes from my side I think.
So I am saying it again now. Good to have you back in the forum, without you it’s not the same.
And on goes the journey.
I modified the scene:
https://github.com/swunsch/sofa-help/blob/master/05_rotating_beam/quest_1_1/beam_rot_16_rigi_bilat_face.scnAnd I am seeing too much movement/flexibility in the constraint:
I want to make the constraint stiffer or somehow reduce this violation. Which parameters can be adjusted?
4 March 2020 at 14:38 in reply to: [SOLVED] RigidMapping from Rigid3d to only some particles of FEMbody #15277SimonMemberoops..
and from https://www.sofa-framework.org/community/forum/topic/rigid-multibody-modeling-in-sofa/maybe I had an overall solver missing.
Looks much better now. Now I guess I have to adjust my rotation speed.
-
AuthorPosts