Home › Forum › SOFA › Using SOFA › [SOLVED] Problems with finding indices
Tagged: 64_bits, Linux_ubuntu, SOFA_1512
- This topic has 8 replies, 2 voices, and was last updated 8 years, 5 months ago by Hugo.
-
AuthorPosts
-
2 June 2016 at 15:40 #6959BenBlocked
How can I determine the indices of every node in the mesh of interest within SOFA? I am new to SOFA but I know that I can refer to the tetrahedrons in my mesh with @loader.tetras. Is there a way to do this with nodes? Currently I need to use PlaneROI and then PlaneROI@indices. This is cumbersome and I suspect there is a much easier way to handle this. I don’t think that it should matter but I am using the MeshGmshLoader.
Similarly I would like to be able to determine the indices within a cylindrical portion of my mesh in order to set a constraint. I have found SphereROI and PlaneROI. Is there no similar CylinderROI?
2 June 2016 at 16:11 #6960HugoKeymasterDear Ben,
When loading a mesh with a loader:
<MeshGmshLoader name="loader" src="myMesh.msh" />
You can access the position of your points using the data"@loader.position"
.
Is that what you want to do?To get the indices of the nodes within a cylinder there is no component already publicly available in SOFA, but it is rather easy to write it. You could get inspired from this : http://www.flipcode.com/archives/Fast_Point-In-Cylinder_Test.shtml. If you need more help on this, let us know.
Hope this helps.
Hugo
2 June 2016 at 16:48 #6961BenBlockedHugo,
Thank you for your help!
I do want what is in @ loader.position but I would like it dumped to a file. (So that I can look at it later.) Currently I use something like:
<PlaneROI name=”TooHard” />
<Monitor indices=”@TooHard.indices” ExportPositions=”1″ />And I can’t see how to use @loader.position more directly.
As for the cylinder. I was hoping for something more out of the box as I am not yet ready to extend the functionality. Let me ask a different but related question. If I have set or group defined within the mesh can the loader extract and use that information? Or does that get lost in the process?
Ben
2 June 2016 at 16:58 #6962HugoKeymasterTo dump the position in a file, you can use an exporter (e.g. VTKExporter or ObjExporter).
You can find out more about the engines and loaders on the online documentation:
https://www.sofa-framework.org/community/doc/using-sofa/basic-components/engines/
On this page, you will find information about what you intend to do: a subset topology (from what I understand). Is that what you need?
2 June 2016 at 17:16 #6963BenBlockedIt looks like that is what I need. I will read over this new documentation. But I still have the loader question, let me re-phrase it. If I have a subset of topology defined in the mesh file that I load into SOFA can that subset of the topology be accessed in SOFA or do I need to re-define it?
3 June 2016 at 10:19 #6965HugoKeymasterHm, I see. At my best knowledge, a subset included inside the loaded mesh is not supported.. What kind of file does support such a subset of the topology?
6 June 2016 at 14:24 #7022HugoKeymasterHi Ben,
Did you succeed in the loading of the main topo and its subset ?
6 June 2016 at 15:53 #7056BenBlockedHugo,
As to the file types that support split topologies, I was thinking about gmsh’s physical groups that allow smaller pieces of the mesh to be identified while preparing the mesh file. Now that I understand that this likely isn’t implemented I’ll manage it in python.
That means yes, I consider this resolved.
6 June 2016 at 15:55 #7057HugoKeymasterCool, thank you for quick reply.
If you need any help with Python let us know.Best regards,
Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.