Light on the face of a mesh changes after csg operation

I found a bug when I use csg to create holes. The light interaction with the mesh face changes after the csg operation. It seems that the face ids are switched and some properties of the face keep the same.
Check this pg: https://www.babylonjs-playground.com/#KQV9SA#401

Hi @mathus1
( First of, for readability, Please tidy up your code in the future before posting :pray: :sweat_smile: )

You can recalculate / create new normals with mesh.createNormals()
This will often be needed when changing the underlying geometry data of a mesh.
Also note, the createNormals function is not perfect, it may sometimes cause small differences from the original normals, but for your mesh it seems fine!

(also moved to questions category :slight_smile:)

1 Like