<p>I am stitching together parts of a mesh and using normal information to interpolate between the gaps.</p>
<p>I am finding that sometimes I get a difference in the normals due to numwrical impressions:</p>
<p><a href="https://i.sstatic.net/XaaNWrcg.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/XaaNWrcg.png" alt="enter image description here" /></a></p>
<p>In the above image one of the normals has a noticeably different angle from the other two, which leads to the formation of a visible ridge in the stitching.</p>
<p>One option I could do, is pass a discrete gaussian filter with 5 weights and then normalize a linear blend of the neighbouring normals. But I wonder if there are better approaches.</p>

CC BY-SA 4.0
2024-10-18T07:16:22.463Z
How do you compute the normals to begin with? Why would you be allowed to smooth those without blurring out the geometry?
lightxbulb
CC BY-SA 4.0
2024-10-18T08:02:52.930Z
This means that you have two vertices in the same position. You can therefore delete one of them and only use the other. One idea is to hash the vertex positions and use one of these vertices. For the normal vector, you can use the average vector or select one of the vertex's normal vectors.
Thomas
CC BY-SA 4.0
2024-10-19T02:01:16.960Z
@lightxbulb as teh angle weighted average of the face normals incident on the vertex.
Makogan
CC BY-SA 4.0
2024-10-19T02:02:09.910Z
@Thomas unlikely that this is the case, meshlab shows that region to contain a single vertex. I think it;s just numerics.
Makogan
CC BY-SA 4.0
2024-10-19T05:04:52.413Z
How did you conclude it's numerical error instead of a specific vertex configuration? You can get widely varying normals corresponding to vertices of the same triangle because they have different 1-ring neighbours. You can see in your picture that the triangulation is irregular where this happens.
lightxbulb
CC BY-SA 4.0
2024-10-19T17:27:57.297Z
There are no duplicate vertices and the mesh representation is a half edge, meaning that I know there are no duplicate faces either.

So the issues is in the computation itself. One problem might be that since it;s on a boundary before the stitching if one triangle is very small compared to the other then the second triangle will dominate the blended normal. So that might be causing the issue.
Makogan
CC BY-SA 4.0
2024-10-19T18:26:27.117Z
Your computation of the normals is causing the issue yes, I don't think it's a numerical imprecision. You can see in your example that at the location where the issue occurs your triangulation is irregular. The first thing to try would be different normal computation methods. Another option is to try to retriangulate the mesh so the triangulation is nicer. You can of course also try to blur things by using a diffusion evolution, but imo that's the wrong solution to the wrong problem. See for example page 91, 5.4.1. in Crane's DDG book.
lightxbulb
<mathematics><computational-geometry><geometry>
How to smooth out normals on a boundary
Makogan
# How to smooth out normals on a boundary

(Asked by: username_0 on 2024-10-17)

I am stitching together parts of a mesh and using normal information to interpolate between the gaps.

I am finding that sometimes I get a difference in the normals due to numwrical impressions:

[![enter image description here](https://i.sstatic.net/XaaNWrcg.png)](https://i.sstatic.net/XaaNWrcg.png)

In the above image one of the normals has a noticeably different angle from the other two, which leads to the formation of a visible ridge in the stitching.

One option I could do, is pass a discrete gaussian filter with 5 weights and then normalize a linear blend of the neighbouring normals. But I wonder if there are better approaches.

**Tags:** mathematics, computational-geometry, geometry

> **Comments:**
> **username_1**: How do you compute the normals to begin with? Why would you be allowed to smooth those without blurring out the geometry?  
> **username_2**: This means that you have two vertices in the same position. You can therefore delete one of them and only use the other. One idea is to hash the vertex positions and use one of these vertices. For the normal vector, you can use the average vector or select one of the vertex's normal vectors.  
> **username_0**: @username_1 as teh angle weighted average of the face normals incident on the vertex.  
> **username_0**: @username_2 unlikely that this is the case, meshlab shows that region to contain a single vertex. I think it;s just numerics.  
> **username_1**: How did you conclude it's numerical error instead of a specific vertex configuration? You can get widely varying normals corresponding to vertices of the same triangle because they have different 1-ring neighbours. You can see in your picture that the triangulation is irregular where this happens.  
> **username_0**: There are no duplicate vertices and the mesh representation is a half edge, meaning that I know there are no duplicate faces either.  So the issues is in the computation itself. One problem might be that since it;s on a boundary before the stitching if one triangle is very small compared to the other then the second triangle will dominate the blended normal. So that might be causing the issue.  
> **username_1**: Your computation of the normals is causing the issue yes, I don't think it's a numerical imprecision. You can see in your example that at the location where the issue occurs your triangulation is irregular. The first thing to try would be different normal computation methods. Another option is to try to retriangulate the mesh so the triangulation is nicer. You can of course also try to blur things by using a diffusion evolution, but imo that's the wrong solution to the wrong problem. See for example page 91, 5.4.1. in Crane's DDG book.  

---

## 0 answers

