How to get the normal of a point on a on_mesh


#1

how to get the normal of a point on a on_mesh


(Dale Fugier) #2

You might start with this example:

https://github.com/mcneel/Rhino5Samples_CPP/blob/master/SampleCommands/cmdSampleGetPointOnMesh.cpp

Also, if a mesh has face normals, you can find in ON_Mesh::m_FN. If a mesh does not have face normal, you can compute them by call ON_Mesh::ComputeFaceNormals.


#3

dale :smile:
this example just deal with point.m_ci.m_type == ON_COMPONENT_INDEX::mesh_face
condition,but in fact ,the type also maybe other values,for example:ON_COMPONENT_INDEX::meshtop_edge,So I need know how to deal with all other
conditions.


(Dale Fugier) #4

A topological edge does not have a normal. If you pick an edge, you will have decide which shared face you want to test.


#5

thanks very much.
I will try using the closest vetex normal,because I find ComputerFaceNormal is too slow computer every time