Hello,
In Grasshopper I am trying to get the vertex normals of a mesh. The issue is that, as shown by the planes, the direction of these normals seem off. What is causing this? It is worth noting that it is a closed mesh with welded seams.
James
The normals on a welded tetrahedron are not consistent. A similar problem can be seen on a simple mesh box.
mesh-normals-issue.gh (21.4 KB)
Thanks for pointing this out this issue, Martin. If I wanted correct vertex normals all across my mesh, would you recommend getting an average of the normals of the surrounding faces of the vertex? If so, is this achievable with components? I do not know code.
James
“By hook or by crook”. I feel like I mostly stumbled my way through this one. Not made to work on multiple meshes. Maybe @inno or @martinsiegrist has a better idea:
Hello
I think there is a bug in Weld Mesh, normals are not recomputed. @dale, @DavidRutten
Using Unify Normal updated the normals
Or welding with other tools,
WeldMesh from Ngon works
Weld Mesh from Nautilus works (old and new version)
Combine&Clean from Kangaroo works
Join&Weld from Fennec and Align Vertices doesn’t work,
A mesh, in its simplest form, is just a set of vertices and faces that records which vertices belong to which faces, but nothing more about higher‑level topology.
A normal is typically a unit vector orthogonal to a planar geometric element, such as a mesh face.
Individual mesh vertices do not inherently have normals, because there is no unique direction that must be orthogonal to a point; any direction through that point would be equally valid.
What you want in practice is a “vertex normal”: a unit vector obtained by summing the normals of all faces adjacent to that vertex and normalizing it.
To compute such a vector, you need topological information, specifically which faces are incident to each vertex.
I had never noticed this issue before, thank you for pointing it out.
@Volker_Rakow Thank you for the idea. I tried to take it a step further to make it work with data trees as well. Let me know if it works.
mesh vertex normals.gh (18.5 KB)
This was done without any plugins or coding. With some scripting I imagine there is a faster way to obtain the vertex-to-faces relationship.
This post by Daniel Piker contains a script for the vertex faces.