- This topic has 3 replies, 3 voices, and was last updated 5 years, 5 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Using SOFA › [SOLVED] Extracting the normal vector of each vertex
Tagged: 64_bits, Linux_ubuntu, Plugin_other, SOFA_1706
Hi,
In the run window, there is an option for showing the normal vectors of the vertices in the mesh. How can I extract those normal vectors in python?
Best,
Zahra
Hi @zahra
This is a good question. I never asked me this before.
I don’t think there is an existing way to get the normals while the object is moving. Have you found any way? At my best knowledge, normals can be found in Loaders (MeshVTK/Obj/STLLoader) at init.
This could be a nice feature to expose the normals as a datafield in the SetGeometryAlgorithms and pull-request this ! Would you feel confident to try it?
Best,
Hugo
Hi,
the normal you see in the window are coming from the OglModel of your scene.
Each OglModel has a Data normal
. I’m not used to create scene in python but I’m quite sure you can access directly Data values of component.
Be sure to have updateNormals
set to true in the OglModel
Erik
Dear Erik,
Thank you very much for your hint. Yes, the normal data field in OglModel is what I was looking for, and now I can access and use it.
Dear @Hugo,
Thank you for your reply. Erik’s guidance solved this issue, and so I think there is no need anymore to pull-request it.
Best wishes,
Zahra
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.