Bad normals

This is an issue I hit whilst revising Lund Church.

A model is made up of polygons, and each polygon has a front and a back. In Blender it is not obvious which is which, though Blender does track it. And occasionally it gets it wrong, and a section of mesh is, in effect, inside-out. When you try to print out, there is just a hole there.

In the image below you can see some of the stones to the left of the windows are not just missing but also caused holes in the superstructure.



Microsoft 3D Builder does not spot it, all looks good in there. But Chitubox does. It will not actually say anything or stop you producing a bad file, but it does highlight bad bits in your model. In the image below, all that roof is wrong, the right side of the arches, a part of the cross at the end of the roof, and some stones in the tower. All are shown in a much darker colour.


So what are normals?

Behind the scenes Blender creates a vector (essentially a line) that starts from the centre of the polygon and extends out at the front, at a right angle (i.e. normal to) the plane of the polygon. In an earlier version of Blender you could show normals. This is how it looks in edit mode, X-ray turned on, with face select. The cube on the left has the normals pointing inwards - it is inside-out and will not print. The cube on the right is good, with all the normals pointing outwards.


Of course, if your object has a hole in it, the normals round the hole need to point into the hole.

Blender 4.0 has a new way to show face alignment that is considerably easier. Click the "Overlays" button, a down-arrow beside two overlapping circles top right of the 3d Viewport screen. In the panel that appears, there is a "Face orientation" checkbox.


With that ticked, the front of each face will be blue, the back will be red. This makes it very easy to spot bad normals.



What do I do about it?

Once you have identified bad normals, it is easy to correct them. Just select the offending faces in Edit mode, and flip them by pressing [ALT]-N, and selecting "Flip" from the menu.

The tricky bit is finding them all and selecting just the right ones.

One thing to try is, in Edit mode, with Vertex select, do "Select by non-manifold".


This can pick up other issues, but might pick up the ones you want and you can just flip them.


Why does it happen?

This is the big question!

Since I first wrote this page, I have discovered that it happens when you mirror an object, and then apply the scale. When you mirror an object through, say, the X-axis, Blender just changes the X-scale to a negative number. And that works fine.

However, if you then apply that scale - or join the object to another - Blender will reverse all the normals. I consider this a bug, but I am told it is what it is supposed to do.

https://projects.blender.org/blender/blender/issues/115529

If you know about it in advance it is not too bad, as you can deal with it as it happens.

If you are joining objects and one of them is mirrored, do Object - Apply - Scale on the mirrored object first.

Whenever you do Object - Apply - Scale on a mirrored object, check its normals, and correct them immediately - before you join it up to another object.

A mirrored object is any object with a negative scale on any axis!

Comments

Popular posts from this blog

Introduction to the Blog

Various tank wagons

Safety First!