- Only calculate the necessary normals based on smooth/flat/mixed shading
- Use cached face normals instead of computing them
- Use a `VectorSet` for deduplication instead of a `Map`
- Deduplicate vertex normals and store indices in separate loops
- Avoid unnecessary duplication of face normal indices
- Inline simple function for slicing index span
Export time (ms) of 1.8m vertex mesh:
| Normals Domain | Before | After |
| --------------- | ------ | ----- |
| Face (flat) | 559 | 469 |
| Vertex (smooth) | 659 | 466 |
| Corner (mixed) | 656 | 640 |
The change of using normals from different domains and using a
VectorSet for de-duplication change the order of normals in the OBJ
files. Other than that, the results should be unchanged.
Fixes#117510
Pull Request: https://projects.blender.org/blender/blender/pulls/117522