Forum Replies Created
-
AuthorPosts
-
14 November 2018 at 19:01 in reply to: [SOLVED] Could sofa use full Python instead of being embedded in XML file using component #12449HugoKeymaster
Hi @xiaojuan
Are you already using Python in your simulation?
You can write a scene only in a .py file and run it with runSofa. However, as soon as you need interactions during the simulation (or printing information for your debugging) you need a PythonScriptController.Another solution would be to compile SOFA in debug mode, not sure that’s what you want to do.
BestHugo
HugoKeymasterHi @hkomninos
Indeed mappings create correspondences between representations (e.g. between the mechanical and the collision model). You can find a doc page on Mapping.
You can indeed use different meshes for both representations and use the BarycentricMapping instead of the Identity one.Best
Hugo
HugoKeymasterDear @hkomninos
As the plugin name indicates it, the Multithreading plugin allows to use parellelism methods (like TaskScheduler) in SOFA at different level of the simulation. It might need a bit of experience in SOFA to handle it, but do not hesitate to look at the included examples.
Best
Hugo
14 November 2018 at 19:01 in reply to: [SOLVED] How to give offset distance of collision in geomagic haptic simulation #12446HugoKeymasterHi @wassitte
Spyder is an IDE that generates a Python environment. Until now, Python scripts for SOFA can only be run from the runSofa executable. SOFA is not yet compatible with usual Python environment. This is an ongoing project, stay tuned!
Hugo
HugoKeymasterDear @jangirrishabh
You are right, the function simulationStep() of a Node (e.g. rootNode) does only bind the animate() function.
/// step the simulation static PyObject * Node_simulationStep(PyObject * self, PyObject * args) { Node* node = get_node(self); double dt; if (!PyArg_ParseTuple(args, "d",&dt)) { return NULL; } getSimulation()->animate ( node, (SReal)dt ); Py_RETURN_NONE; }
Unfortunately, the AnimationLoop does not seem to be bound in Python.
An alternative could be to send the two required Visitors just after your call as follows:rootNode.simulationStep(dt) rootNode.executeVisitor(UpdateSimulationContextVisitor) rootNode.executeVisitor(UpdateMappingVisitor)
But I never did trigger visitors in Python myself.
Let me know whether this works.
BestHugo
HugoKeymaster2 November 2018 at 16:50 in reply to: [SOLVED] How to give offset distance of collision in geomagic haptic simulation #12324HugoKeymasterDear @suwan,
Have you tried my piece of code above?
I think this should work to add a new MechanicalObject translated as you desire.Best
Hugo
HugoKeymasterHi @hkomninos
Indeed the CUDA-based version of the class CorotationalFEMForcefield is not implemented, therefore not available. Writing codes using the NVIDIA toolkit is (really) far from trivial. If you want absolutely to use a corotational approach, you can go for the FastTetrahedralCorotationalForceField: it is not GPU compatible but it is an optimized version.
Otherwise you will find:
- CudaTetrahedronFEMForceField: linear elasticity
- StandardTetrahedralFEMForceField: hyperlastic materials
- CudaTetrahedronTLEDForceField: anisotropic viscoelasticity for soft tissue simulation
I hope this helps.
Best wishes,Hugo
2 November 2018 at 16:47 in reply to: [SOLVED] How to model a deformable object with a deep crevice? #123222 November 2018 at 16:47 in reply to: [SOLVED] Could sofa use full Python instead of being embedded in XML file using component #12321HugoKeymasterHi @xiaojuan
What do you mean exactly by “step debug Python scene file instead of embedding the python script” ?
BestHugo
2 November 2018 at 16:47 in reply to: [SOLVED] how to use node output as "param" for ImageFilter? #12320HugoKeymasterHi @mjbarrow
Data in SOFA can be connected if they have the same type.
If not, or if some processing is necessary, maybe consider going towards python no ?Best
Hugo
HugoKeymasterHugoKeymasterHi @zahra,
As @egarcm mentioned, you can first find documentation online.
Moreover, I would advise you to have a look at the SOFA examples in sofa/applications/plugins/SofaPython/examples/ (especially the EmptyController.py).Note that these scripts can only be run using the executable runSofa but not in a classical Python environment.
Developers of the community are currently working on this new version of SOFA, fully usable in classical Python environments like Spyder.Best,
Hugo
HugoKeymasterDear @rgao16sofa
Indeed the Sensable plugin is not maintained for a while, but I guess we can still make it work.
Here some debugging is necessary.Have you look into the create() function of your Sensable plugin?
Is this function following the BaseObject API?
Is this the entire error log?Are you joining us at the SOFA Week? it would make debug easier.
Best
Hugo
HugoKeymaster29 October 2018 at 13:37 in reply to: Bug. Mismatch between image plugin .obj and .png co-ordinate systems #12290HugoKeymasterDear @mjbarrow,
Could you find a way to provide us a link (wetransfer or any other) of your image?
This would really ease the testing.Did you take a look at the BeamLinearMapping component?
Best,
Hugo
29 October 2018 at 13:37 in reply to: [SOLVED] How to model a deformable object with a deep crevice? #12289HugoKeymasterDear @outtt ,
If I understand correctly, you want to simulate:
– a deformable object with an initial cut/crevice
– an auto-collision modelIs this correct?
Can you give us a bit of context: what kind of object is this suppose to be?For collision, any simulation should start without a collision as initial condition. Therefore your collision parameters must be well chosen. I need to find some info regarding the auto-collision since I never did it myself.
Best,
Hugo
29 October 2018 at 13:36 in reply to: [SOLVED] How to give offset distance of collision in geomagic haptic simulation #12288HugoKeymasterDear @suwan,
The Geomagic driver only returns the base and the tool tip positions and orientations. However, based on this information, you can easily create a translated frame (on the handle of the tool) by applying a translation in the x direction (from your picture):
<GeomagicDriver name="GeomagicDevice" deviceName="Default Device" positionBase="0 0 0" orientationBase="0 0.707 0 -0.707" /> .. <Node name="anotherSubNode"> <MechanicalObject name="translatedFrame" template="Rigid" position="@../GeomagicDevice.positionDevice" translation="1 0 0" /> </Node>
Let me know if this is what you intend to do?
Best,Hugo
HugoKeymasterSince it is solved, I mark it solved.
Do not hesitate to let me know whether the links were useful or the reason of your previous issue.Best
Hugo
26 October 2018 at 18:30 in reply to: [SOLVED] How can I construct a stable beam force field while the beams are not straight? #12279HugoKeymasterThank you so much @mmabrouk for noticing us!
The right place to indify such issues with the code is the GitHub issues. There you can create new issue when needed!
However, the getDataFields seems outdated. I always used only the mechanicalobject.findData(“position”).value writing.
I created a GitHub issue for you for the MeshSpringForceField.
Best wishes,
Hugo
PS: is there anyone from Berlin willing to join us in Strasbourg for the SOFA Symposium?
HugoKeymasterDear @demkhuyenmai,
SOFA is an open-source framework for multi-physics simulation and is being developed for more than 11 years. Today, SOFA benefits from a large international community made up of research centers and companies.
What are your simulation objectives? Note that GPU computing is available with SOFA.
Best,
Hugo
-
AuthorPosts