Forum Replies Created
-
AuthorPosts
-
2 November 2021 at 18:54 in reply to: Problems with ‘CubeTopology’ when using ‘BeamFEMForceField’ #20722HugoKeymaster
Dear @andrija987
Sorry for the delay. The organization of the SOFA Week 2021 is keeping us busy.
I thought again about your issue. The BeamLinearMapping is a mapping computing a non-linear interpolation between the rigid frames (see the code here). If you want to have a CubeTopology which curvature is locally discontinuous (90deg angles between beam 2 and 3) it will be interpolated following the function line 158. Using this BeamMapping you could try to change the orientation of the frame number 3:
[23, 2, -2, 0, 0.41321628, 0, 0.91063291],
and replace it by the linear interpolation of the orientation of the frame 2 and 4.
Else, I wonder if you are not interested in a RigidMapping instead (no interpolation, just mapping cubes over a rigid frame). You can see the example for instance using the RigidMapping example.
Hope this helps.
BestHugo
HugoKeymasterOla @benjamin !
Great news, it should very soon be released in open-source (in the sofa-framework GitHub account).
It will therefore be out, stay tuned!Best
Hugo
HugoKeymasterHey @jducrocq007
Since the topic is now well identified and open in a GitHub issue, I think we can close this topic and follow up in the issue. Is it fine for you?
Best
Hugo
HugoKeymasterIn my case I ran :
wget https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip sudo unzip ninja-linux.zip -d /usr/local/bin/ sudo update-alternatives --install /usr/bin/ninja ninja /usr/local/bin/ninja 1 --force
Best
Hugo
HugoKeymasterHey @benjamin
it would be a huge plus for the code definitely!
For contributing you will have to get the sources of the BeamAdapter plugin. Do you have access to it?Best
Hugo
HugoKeymasterHi @daserk
It’s strange. What is
LRmodel
? Is it a node ?
The functiongetObject
should work an example here ifliver
is a node anddofs
is an object in this node (a MechanicalObject here):liver.getObject("dofs").findData("position").value
Best
Hugo
HugoKeymasterHey SOFA forum!
We’re almost in November now!
It’s definitely the time to register to the SOFA Week: https://www.sofa-framework.org/sofa-events/sofa-week-2021/registration/Looking forward to having you among us!
Best wishes,
@anoushs @mckysd5 @twxu @tschuelia @albanodot @estefania @torri @amackeith @olivier-goury @PierreShg @younesssss @Scheikl @Olumide @tgaugry @cereven @jonny @davacas @abdelrahman2010 @qdyuan4619 @daserk @bmanz–
The SOFA Consortium staff21 October 2021 at 22:11 in reply to: How to modify and object in the scene and restart simulation #20683HugoKeymasterHi @qdyuan4619
Have you looked at the forcefield example in the SofaPython3?
Else regarding restarting a simulation in python, @PierreShg may help on this. It could cool to have an example of this in the SofaPython3 plugin!
Hugo
HugoKeymasterHey @qdyuan4619
I was going to say from your first post, the SOFA_ROOT and PYTHONPACKAGE environment variables would be wrongly set.
You mean to load an image on the forum ? You must give a link to the image itself not the sharing google link.
Is this topic solved though? Shall we close it?
Best
Hugo
HugoKeymasterAnd guys, do not forget about the SOFA Awards!
Apply with your open contributions! Already 3 candidates…
HugoKeymasterHi Bani
A solution is available in the PR #2155. It will soon be merged inside SOFA.
Best wishes,
Hugo
HugoKeymasterHi @vanisri
If you have the motivation you can migrate to v21.06.01 and see if this helps.
But when having theimport stlib
in a python script, it means that the scene is looking for python2 codes.
For python3, the import should be changed toimport stlib3
Best
Hugo
19 October 2021 at 12:50 in reply to: [SOLVED] How to use HexahedronCompositeFEMMapping in cpp #20663HugoKeymasterGreat thanks for the feedback @dst03251
Could you pull-request this change in SOFA? (contributing doc)Thanks a lot!
Best wishes,Hugo
HugoKeymasterDamned I get the same error.
The SOFA loader seems therefore not to support the latest gmsh format.I created a dedicated issue on GitHub.
I will keep you posted.
Best
Hugo
HugoKeymasterThe STLIB plugin is not under our management. The migration towards python3 (NOTE: you should rather use
import stlib3
) is currently being done. Therefore, you might have noticed uncomplete cover of the STLIB features (some scenes are still only python2 compatible).Do not hesitate to report them here: https://github.com/SofaDefrost/STLIB/issues. It will help developers to upgrade the plugin.
Best,
Hugo
HugoKeymaster18 October 2021 at 14:54 in reply to: [SOLVED] How to use HexahedronCompositeFEMMapping in cpp #20646HugoKeymasterHey @dst03251
Sorry I have not, but did you check out the example scenes:
– examples/Components/forcefield/HexahedronCompositeFEMForceFieldAndMass.scn
– examples/Components/mapping/HexahedronCompositeFEMMapping.scn?
Best
Hugo
HugoKeymasterHi @vanisri
Please provide us more insight about your problem:
– the file about which you are talking
– the full error log you are receiving
– you confirm you are using the v21.06 SOFA release?Best
Hugo
HugoKeymasterHi @arsalan
Sorry I never did such a communication setup. However, regarding the data format maybe @damien-marchaluniv-lille1-fr would be able to provide more insight than I do..
Damien any idea?Best
Hugo
HugoKeymasterIt confirms that both
SOFA_ROOT
andPYTHONPATH
are not defined.
Could you define them as detailed here for Windows: https://sofapython3.readthedocs.io/en/latest/menu/SofaPlugin.html#within-a-python3-interpreter (click on the Windows button)And then, check again these paths as you did above:
echo SOFA_ROOT = %SOFA_ROOT% echo PYTHONPATH = %PYTHONPATH%
Best
Hugo
HugoKeymasterHugoKeymasterHi @cereven
This piece of code does not crash on my end (with a few modif to make it a real script):
import Sofa def createScene(root): root.addObject("LightManager", listening=True, shadows=True, softShadows=False) root.addObject("OglShadowShader", name="shadowShader") endo = self.root.addChild("Endoscope") light = endo.addChild("light") light.addObject("SpotLight", name='spotlight', direction=f"offset_engine.positions", lookat=True, cutoff=90, # angle in degrees position=f"@{name}_camera_system.output_position", attenuation = "0.15", shadowTextureSize="128", exponent=1, shadowsEnabled=True)
However, OglShadowShader is a very old component because rendering is not any more performed within SOFA but rather within Blender or Unity. A tutorial should soon come out explaining how to do such a rendering in Blender !
Best wishes,
-
AuthorPosts