4

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

Tyson
  • 1,226
  • 1
  • 10
  • 33
  • 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 May 25 '18 at 22:48
  • 1
    won't normalization by area solve the issue? – Anton Menshov May 26 '18 at 02:00
  • @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 May 26 '18 at 13:24
  • @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 May 26 '18 at 14:03
  • @Anton The ideal solution would be face-area agnostic. – Tyson May 27 '18 at 01:59
  • You should read what "[median](https://en.wikipedia.org/wiki/Median)" actually means -- in your last example the red arrow is not the median of the blue arrows. Generally, the suggestion by @Anton was right, though as you found yourself, here it is better to weigh by angle instead of area. – chtz May 28 '18 at 06:46

1 Answers1

3

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.

Henry Ecker
  • 34,399
  • 18
  • 41
  • 57
Tyson
  • 1,226
  • 1
  • 10
  • 33