Forum Replies Created
-
AuthorPosts
-
14 August 2018 at 15:03 in reply to: [SOLVED] How to extract the surface of a volumeyric mesh #11673ZahraBlocked
Thank you for leading me to this point. You are right, by using Tetra2TriangleTopologicalMapping and MeshExporter I can get the surface mesh.
What misleaded me was that the number of nodes of both surface and volume meshes remained the same, however, I recognized that the inner nodes become disconnected (the number of elements are reduced in the surface mesh).
I really appreciate your time.
Best regards,
Zahra
14 August 2018 at 14:35 in reply to: [SOLVED] How to extract the surface of a volumeyric mesh #11671ZahraBlockedHi Hugo,
I am using the stable branch of SOFA now v17.06.
Zahra
14 August 2018 at 12:36 in reply to: [SOLVED] How to extract the surface of a volumeyric mesh #11667ZahraBlockedDear Hugo,
As I have mentioned to Binesh, ObjExporter causes an error.
The idea of creating a new class Tetra2SurfaceTriangleTopologicalMapping is appealing, however, I never accomplished such a code in SOFA before (my programming skill is to the level of MATLAB). I have recently learned python but I still have problems with python scripting in sofa
Is it possible that you kindly give me some guiding steps to know how to create Tetra2SurfaceTriangleTopologicalMapping class?
How only the triangles on the border should be selected?
I am sorry if I am asking too many questions 😐
Best,
Zahra
14 August 2018 at 12:03 in reply to: [SOLVED] How to extract the surface of a volumeyric mesh #11666ZahraBlockedHi @Binesh,
I tried ObjExporter, here is the .scn file:
https://gist.github.com/zbounik/d3bc51ade6b27f04fa38b38e6b8fcdf7
It causes this error which I can not figure out:
https://gist.github.com/zbounik/328f316a4e8616dd053f9a30b5f68ec5
Best,
Zahra
14 August 2018 at 11:37 in reply to: [SOLVED] How to extract the surface of a volumeyric mesh #11665ZahraBlockedHi @jnbrunet,
Thank you for your comment. I ran your code, I am not that much familiar with vtk format (I use gmsh), however, I guess it still extracts the whole volume. I see the number of nodes are 510 which is the same number of nodes in the cylinderical volume. If it extract the surface, the number of the nodes should be less than that.
Best,
Zahra
11 August 2018 at 13:04 in reply to: [SOLVED] How to extract the surface of a volumeyric mesh #11650ZahraBlockedHi Bruno,
Thank you for your help. I tried the Tetra2TriangleTopologicalMapping.scn, but when I add a meshexporter to the “T” node of the aforementioned example to extract the surface, it still extracts the triangles of the whole volume, not just the surface. DO you have any idea why?
ZahraBlockedHi Hugo, hi Binesh,
Thank you for your response.
Best,
Zahra30 July 2018 at 12:37 in reply to: [SOLVED] no "createScene" nor "createSceneAndController" module method found error #11613ZahraBlockedDear Hugo,
You have mentioned that “simply run the script and then run runSofa caduceusPython.py”, I am so sorry but I am really confused: Which script I should run before ‘runSofa caduceusPython.py’?
30 July 2018 at 11:35 in reply to: [SOLVED] no "createScene" nor "createSceneAndController" module method found error #11612ZahraBlockedDear Noura,
Thank you for your guidance. As you mentioned, I am running this:
/home/zahra/sofa/Sofa17.06/build/bin/runSofa /home/zahra/sofa/Sofa17.06/src/examples/Demos/caduceusPython.py
and I am getting this error:
cannot create Scene, no "createScene(rootNode)" nor "createSceneAndController(rootNode)" module method found.
I can not find what is the problem. I appreciate your help.
I tried to copy the caduceusPython.py here, but then your system considers my message as a spam.ZahraBlockedDear Hugo,
I am trying to impose displacement and velocity of a node in a mesh to a node of another mesh using python. It is my first attempt to use python, however, but I have no idea what steps I should accomplish. I would appreciate any hint to do this.
best,
ZahraZahraBlockedDear Hugo,
Thank you for your comment. I will try your helping points.
Best wishes,
Zahra
ZahraBlockedDear Hugo,
I appreciate your consideration.
Best,
Zahra
ZahraBlockedEmm… I have found this post:
which has the same problem as mine and my problem solved. I wish it would have been mentioned somewhere in the installation document that the modeler does not work properly in the version 17.12. It would be a save in time.
Best,
Zahra
ZahraBlockedHi again,
Thank you Hugo, I am learning to use python for this.
Best,
ZahraZahraBlockedHi again,
Thank you Noura for your help. I should add that now when I type “runSofa”, the Caduceous scene opens in the run window and it works properly as I animate it. However, when I type “Modeler”, the modeler opens. When I open a scene in a modeler, either from tutorial or from my own scenes and I hit the run button, I get this error:FROM SOFA [ERR] >> unrecognised option ‘-t’
Sofa exited safely.
Can anyone help me regarding this issue?
Best,
ZahraZahraBlockedAmmm…Sorry but I am new in Linux! when I open modeler, there is just one window! where I should look for the error messages? In the terminal? If so, when I run the scene, nothing shows in the terminal.
by typing “/home/zahra/sofa/build/v17.12/bin/runSofa”, I receive the following messages:
~/sofa/build/v17.12/bin$ /home/zahra/sofa/build/v17.12/bin/runSofa
[INFO] [runSofa] Loading automatically default plugin list from /home/zahra/sofa/build/v17.12/lib/plugin_list.conf.default
[INFO] [SofaPython] Added ‘/home/zahra/sofa/src/applications/plugins/SofaPython/python’ to sys.path
[INFO] [SofaPython] Added ‘/home/zahra/sofa/src/applications/plugins/PSL/python’ to sys.path
[INFO] [SofaPython] Added ‘/home/zahra/sofa/src/applications/plugins/SofaTest/python’ to sys.path
[INFO] [PluginManager] Loaded plugin: /home/zahra/sofa/build/v17.12/lib/libSofaPython.so
[INFO] [PluginManager] Loaded plugin: /home/zahra/sofa/build/v17.12/lib/libCImgPlugin.so
[INFO] [PluginManager] Loaded plugin: /home/zahra/sofa/build/v17.12/lib/libSofaSphFluid.so
[INFO] [PluginManager] Loaded plugin: /home/zahra/sofa/build/v17.12/lib/libSofaMiscCollision.so
[INFO] [PluginManager] Loaded plugin: /home/zahra/sofa/build/v17.12/lib/libPSL.so
[INFO] [PluginManager] Loaded plugin: /home/zahra/sofa/build/v17.12/lib/libSofaAllCommonComponents.so
The constructor with a QGLFormat is deprecated, use the regular contructor instead.ZahraBlockedHi Naura,
Thank you for your reply. I installed GLUT, but the scenes still do not run…
ZahraBlockedHi Hugo,
Thank you 🙂
– There is a folder named sofa which contains two folders, src and build. The ‘build’ contains the ‘v17.12’ folder which is my final build directory.
– I ran all the instructions mentioned in this page: https://www.sofa-framework.org/community/doc/getting-started/build/linux/ except the “clang” section (I am using GCC).
– Yes, in cmake-gui, I defined the source path as: /home/zahra/sofa/src and the build path as: /home/zahra/sofa/build/v17.12. The build.ninja file is created in my build folder.
At this point I should mention that I succeeded in compiling by ninja: When I removed the entry “CMAKE_PREFIX_PATH” from cmake, the file compiled with no error. Now, my problem is that no .scn file run in the modeler, even the scenes in the tutorial do not run.
– emm…Must I also set up the QtCreator besides compiling by ninja?(as explained in the aforementioned page?)
– May the problem be that, cmake says that it “Could NOT find GLUT (missing: GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)”? (It does not seem like an error in cmake).
– The only change I did to cmake was adding SOFAPYTHON plugin. May it be the cause of not running the scenes?
ZahraBlockedHi Hugo,
Thank you for your reply. I can attach the position using attach constraint, but what about the velocity?
Best,
Zahra28 October 2017 at 08:30 in reply to: [SOLVED] How to generate one specific deformation in two different mesh resolutions? #10096ZahraBlockedDear Hugo,
Yes, now I can see both of the models. Thank you very much for your kind help.
Best regards,
Zahra
2 October 2017 at 09:49 in reply to: [SOLVED] How to generate one specific deformation in two different mesh resolutions? #10024ZahraBlockedDear Hugo,
I appreciate your kind help, however, you deleted the part that I needed for my simulation. I think I did not obviously explain my problem on this topic. What I want from this simulation is to drive a coarse mesh by a fine one and I want to illustrate both of the meshes, i.e. coarse and fine mesh in one scene. To do this, I used three barycentric mapping component:
– a visual barycentric mapping for the visual model of the fine mesh
– a mechanical barycentric mapping to map from fine to coarse mesh
– a visual barycentric mapping for the visual model of the coarse meshIs this a true procedure? If so, my problem is that I can not see the final result in the scene, i.e. the coarse mesh which is derived by the fine mesh. I receive the following error by adding the barycentric mapping for the visual model of the “coarse mesh”:
FROM SOFA [ERR] >> ########## SIG 11 – SIGSEGV: segfault ########## FROM SOFA [ERR] >> 26 FROM SOFA [ERR] >> : sofa::helper::BackTrace::dump – 0x7ffd94693f90 25: sofa::helper::BackTrace::sig – 0x7ffd94694120 24: XcptFilter – 0x7ffd9f5dfaf0 23: XcptFilter – 0x7ffd9f5dfaf0 22: _C_specific_handler – 0x7ffd9f5df238 FROM SOFA [ERR] >> 21: _chkstk – 0x7ffdc664aa50 20: RtlImageNtHeaderEx – 0x7ffdc65e94b0 19: KiUserExceptionDispatcher – 0x7ffdc6649c50 18: sofa::component::mapping::BarycentricMapperTetrahedronSetTopology<sofa::defaulttype::StdVectorTypes<sofa::defaulttype::Vec<3,double>,sofa::defaulttype::Vec<3,double>,double>,sofa::defaulttype::ExtVectorTypes<sofa::defaulttype::Vec<3,float>,sofa::defaultty – 0x7ffd791d9220 17: sofa::component::mapping::BarycentricMapping<sofa::defaulttype::StdVectorTypes<sofa::defaulttype::Vec<3,double>,sofa::defaulttype::Vec<3,double>,double>,sofa::defaulttype::ExtVectorTypes<sofa::defaulttype::Vec<3,float>,sofa::defaulttype::Vec<3,float>,floa – 0x7ffd791dad20 16: sofa::core::Mapping<sofa::defaulttype::StdVectorTypes<sofa::defaulttype::Vec<3,double>,sofa::defaulttype::Vec<3,double>,double>,sofa::defaulttype::ExtVectorTypes<sofa::defaulttype::Vec<3,float>,sofa::defaulttype::Vec<3,float>,float> >::apply – 0x7ffd79f1b9a0 15: sofa::simulation::UpdateMappingVisitor::processMapping – 0x7ffd9e244f30 14: sofa::simulation::UpdateMappingEndEvent::~UpdateMappingEndEvent – 0x7ffd9e244ba0 13: sofa::simulation::UpdateMappingVisitor::processNodeTopDown – 0x7ffd9e245030 12: sofa::simulation::graph::DAGNode::executeVisitorTopDown – 0x7ffd9b028a20 11: sofa::simulation::graph::DAGNode::executeVisitorTopDown – 0x7ffd9b028a20 10: sofa::simulation::graph::DAGNode::executeVisitorTopDown – 0x7ffd9b028a20 9: sofa::simulation::graph::DAGNode::doExecuteVisitor – 0x7ffd9b0275f0 8: sofa::simulation::Node::executeVisitor – 0x7ffd9e2246c0 7: sofa::simulation::Simulation::reset – 0x7ffd9e242500 6: sofa::gui::qt::RealGUI::resetScene – 0x7ffd8acbb4f0 5: sofa::gui::qt::RealGUI::setScene – 0x7ffd8acbbe00 4: sofa::gui::GUIManager::SetScene – 0x7ffdbb297220 3: sofa::gui::GUIManager::SetScene – 0x7ffdbb297220 2: sofa::gui::GUIManager::SetScene – 0x7ffdbb297220 1: BaseThreadInitThunk – 0x7ffdc6228350 0: RtlUserThreadStart – 0x7ffdc6607070 FROM SOFA [OUT] >> [WARNING] [SofaSimulationTree] the library has not been cleaned up (sofa::simulation::tree::cleanup() has never been called, see sofa/helper/init.h) FROM SOFA [OUT] >> [WARNING] [SofaSimulationGraph] the library has not been cleaned up (sofa::simulation::graph::cleanup() has never been called, see sofa/helper/init.h) [WARNING] [SofaSimulationCommon] the library has not been cleaned up (sofa::simulation::common::cleanup() has never been called, see sofa/helper/init.h) [WARNING] [SofaSimulationCore] the library has not been cleaned up (sofa::simulation::core::cleanup() has never been called, see sofa/helper/init.h) [WARNING] [SofaCore] the library has not been cleaned up (sofa::core::cleanup() has never been called, see sofa/helper/init.h) [WARNING] [SofaDefaultType] the library has not been cleaned up (sofa::defaulttype::cleanup() has never been called, see sofa/helper/init.h)
Sofa exited safely.
I even can not extract the mapped coarse mesh using any kind of exporters.
I’d be really grateful if you could help me out with this.
Best,
Zahra
18 September 2017 at 11:35 in reply to: [SOLVED] How to generate one specific deformation in two different mesh resolutions? #9987ZahraBlockedDear Hugo,
Thank you for your reply. I have implemented your guide before, but I always face errors. I have put a lot of time to find the cause of the error, but I failed. I am wondering if it is possible for you to kindly have a look on my scene:
<?xml version=”1.0″?> <Node name=”root” dt=”0.02″ > <DefaultPipeline name=”CollisionPipeline” verbose=”0″ /> <BruteForceDetection name=”N2″ /> <DefaultContactManager name=”collision response” response=”default” /> <DiscreteIntersection name=”discreteIntersection1″ /> <Node name=”Liver” depend=”topo dofs” > <EulerImplicitSolver name=”cg_odesolver” printLog=”0″ /> <CGLinearSolver template=”GraphScattered” name=”linear solver” iterations=”25″ tolerance=”1e-009″ threshold=”1e-009″ /> <MeshGmshLoader name=”loader” filename=”d:/work/phd/sofa/liver/liverfinal/testbygmsh/livertetra7509.msh” tetrahedraGroups=” -1 0 38144″ /> <TetrahedronSetTopologyContainer name=”topo” position=”@loader.position” edges=”@loader.edges” triangles=”@loader.triangles” tetrahedra=”@loader.tetras” /> <MechanicalObject template=”Vec3d” name=”dofs” position=”@loader.position” velocity=”0 0 0″ force=”0 0 0″ externalForce=”0 0 0″ restScale=”1″ /> <TetrahedronSetGeometryAlgorithms template=”Vec3d” name=”GeomAlgo” showPointIndices=”0″ /> <DiagonalMass template=”Vec3d” name=”computed using mass density” massDensity=”1″ /> <TetrahedralCorotationalFEMForceField template=”Vec3d” name=”FEM” method=”large” poissonRatio=”0.45″ youngModulus=”1000″ computeGlobalMatrix=”0″ /> <PlaneForceField template=”Vec3d” name=”planeFF0″ normal=”0 1 0″ /> <ConstantForceField template=”Vec3d” name=”constantFF0″ points=”111″ forces=”0 -120 0″ /> <FixedConstraint template=”Vec3d” name=”fixedConstraint0″ indices=”11 17 16 15 14 4 3 0 45 95 42 40 38 39 53 62 61 60 4 63 59 125 24 20 19 9″ drawSize=”0″ /> <MeshExporter name=”meshExporter3″ filename=”c:/users/zahra/desktop/barytestfine” edges=”0″ quads=”0″ hexas=”0″ exportEveryNumberOfSteps=”1″ exportAtBegin=”1″ exportAtEnd=”1″ /> <TetrahedronSetTopologyModifier name=”tetrahedronSetTopologyModifier9″ /> <TetrahedronSetTopologyAlgorithms template=”Vec3d” name=”tetrahedronSetTopologyAlgorithms10″ /> <OglModel template=”ExtVec3f” name=”oglModel0″ material=”Default Diffuse 1 0.666667 0 0 1 Ambient 1 0.2 0.2 0.2 1 Specular 0 1 1 1 1 Emissive 0 0 0 0 0 Shininess 0 45 ” primitiveType=”DEFAULT” blendEquation=”GL_FUNC_ADD” sfactor=”GL_SRC_ALPHA” dfactor=”GL_ONE_MINUS_SRC_ALPHA” /> <BarycentricMapping template=”Vec3d,ExtVec3f” name=”barycentricMap1″ input=”@.” output=”@oglModel0″ /> <Node name=”node3″ > <MechanicalObject template=”Vec3d” name=”mObject0″ position=”0 0 0″ velocity=”0 0 0″ force=”0 0 0″ externalForce=”0 0 0″ restScale=”1″ /> <MeshGmshLoader name=”meshGmshLoader1″ filename=”d:/work/phd/sofa/liver/liverfinal/testbygmsh/livertetra181.gmsh” tetrahedraGroups=” -1 0 596″ /> <BarycentricMapping template=”Vec3d,Vec3d” name=”mapping” input=”@dofs” output=”@mObject0″ /> <VTKExporter name=”vTKExporter1″ filename=”c:/users/zahra/desktop/fromtut19″ edges=”0″ tetras=”1″ exportEveryNumberOfSteps=”1″ exportAtBegin=”1″ exportAtEnd=”1″ overwrite=”1″ /> <TetrahedronSetGeometryAlgorithms template=”Vec3d” name=”tetrahedronSetGeometryAlgorithms0″ /> <TetrahedronSetTopologyAlgorithms template=”Vec3d” name=”tetrahedronSetTopologyAlgorithms1″ /> <TetrahedronSetTopologyContainer name=”tetrahedronSetTopologyContainer2″ /> <TetrahedronSetTopologyModifier name=”tetrahedronSetTopologyModifier3″ /> <Node name=”node2″ > <OglModel template=”ExtVec3f” name=”ogl1″ translation=”0 3 0″ material=”Default Diffuse 1 0.74902 0.74902 0.74902 1 Ambient 1 0.2 0.2 0.2 1 Specular 0 1 1 1 1 Emissive 0 0 0 0 0 Shininess 0 45 ” primitiveType=”DEFAULT” blendEquation=”GL_FUNC_ADD” sfactor=”GL_SRC_ALPHA” dfactor=”GL_ONE_MINUS_SRC_ALPHA” /> <BarycentricMapping template=”Vec3d,ExtVec3f” name=”barycentric2″ output=”@ogl1″ /> </Node> </Node> </Node> </Node>
If it is needed, you can find the two resolutions of liver mesh in the following links:
https://gist.github.com/anonymous/b2ebdecfc51c343abf176722e14390b5
https://gist.github.com/anonymous/79e048b09721684ea43f4fa07f9b0d4b
Also, I use vec3… as my template, however, I am not exactly sure what is the difference between vec3d and extvec3f and … that I used in barycentricmappig. I just used them based on what I have learned from examples. Is there any reference that explains their differences?
Thank you very much for your help.
Best regards,
Zahra13 September 2017 at 13:28 in reply to: [SOLVED] How to generate one specific deformation in two different mesh resolutions? #9979ZahraBlockedHi Hugo,
Sorry for not responding to your following up for this long time, as I have solved my previous problem using another approach and forget about this topic.
Now again I need to use your hint in using barycentric mapping to drive the coarse resolution by fine resolution. I did not succeed as sofa crashes with no error when I want to use this mapping.
Would you please give me more information on how to do that?
– Should I create the fine model and make the coarse model as a child node of it? Or should I put both models at the same level of nodes?
– What kind of barycentric mapping should I use for mapping the fine model onto the coarse one?
Thank you for any guidance in advance,
Zahra
10 June 2017 at 16:57 in reply to: [SOLVED] extracting the visual mesh and the force applied by mouse #9314ZahraBlockedDear Hugo,
…
2. It seems that vtkexporter is a better choice.
3. Just for giving a feedback: Updating the force vector in MechanicalObject does not make any change in the force vector. Activating the verbose flag, after a few seconds, makes sofa stop working.
So I think I should change my approach to my purpose. Thank you for all your helps.Best regards,
Zahra
10 June 2017 at 08:32 in reply to: [SOLVED] extracting the visual mesh and the force applied by mouse #9310ZahraBlockedHi Hugo,
1. It is solved, Thank you.
2. I tried ObjExporter in “TutorialMappingLiverBarycentric.scn” for exporting the visual model: The run window does not open, and just an empty obj file is created, and this warning appeared:
FROM SOFA [OUT] >> [WARNING] [SofaSimulationGraph] the library has not been cleaned up (sofa::simulation::graph::cleanup() has never been called, see sofa/helper/init.h)
3. Um…How I can make sure if the vector is well updated in the GUI? I just open the MechanicalObject and look at the force vector, while at the same time I am applying a force by mouse to the object.
Best,
Zahra
-
AuthorPosts