4
votes

I have a 3D mesh I'm calculating vertex normals for, from the mesh's face normals. Each vertex normal is computed as an average of all the normals of the faces that share that vertex.

All that works fine, except in cases where -- due to uneven subdivision of faces over the surface of the mesh -- vertex normals can be skewed. Here is an example of an object with a skewed vertex normal, in one of its corners:

Box

In this image you can see the various face normals (blue), the ideal vertex normals (yellow), and the problematic vertex normal (red) which is being skewed by the many face normals on the heavily subdivided side of the mesh which all share the vertex.

So my question is: is it possible to calculate a vector median, instead of an average? Here's an extra image to further illustrate:

Median

1
A median only makes sense with a comparison operation, e.g. (relative) angle about a fixed axis - which would probably be the facet normal in this case.meowgoesthedog
won't normalization by area solve the issue?Anton Menshov
@Anton, unfortunately no. The image provided is just an easy to understand example, but there could easily be cases where the problem normals are also attached to faces with a cumulatively greater area than the other normals in the group, resulting in skewing.Tyson
@Tyson so, in the case of a vertex that is shared by faces with unequal areas, you still want to define the normal as if their areas were the same?Anton Menshov
@Anton The ideal solution would be face-area agnostic.Tyson

1 Answers

3
votes

Found the solution here:

https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2015/ENU/Max-SDK/files/GUID-0FCB4578-77F8-4F05-99CD-349E85F13639-htm.html

The idea is to weight the face normals by the angle of the edges that connect to the vertex in question, before adding them to that vertex's normal.

So in my first image, the large grouping of normals on the right would have the same cumulative weight as the single normal on the top/left....resulting in an overall ideal normal for that corner vertex.