2 June 2016 at 15 h 40 min #6959
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 h 11 min #6960
When loading a mesh with a loader:
<MeshGmshLoader name="loader" src="myMesh.msh" />
You can access the position of your points using the data
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.
Hugo2 June 2016 at 16 h 48 min #6961
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?
Ben2 June 2016 at 16 h 58 min #6962
To 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:
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 h 16 min #6963
It 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 h 19 min #6965
Hm, 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 h 24 min #7022
Did you succeed in the loading of the main topo and its subset ?6 June 2016 at 15 h 53 min #7056
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 h 55 min #7057
Cool, thank you for quick reply.
If you need any help with Python let us know.
- You must be logged in to reply to this topic.