alecjacobson / gptoolbox

Matlab toolbox for Geometry Processing.
MIT License
628 stars 166 forks source link

cotmatrix and direction of mean curvature normal #45

Closed SuwoongHeo closed 6 years ago

SuwoongHeo commented 6 years ago

image image Hello there, I had computed discrete cotangent Laplacian matrix of a surface by using cotmatrix.m. In above, the directions of discrete mean curvature normal(Orange arrow) of several points are not in the opposite direction of vertex normal direction(Blue arrow). It occurs for several points marked as red in the first figure. Does this problem come from mesh structure?

alecjacobson commented 6 years ago

mean curvature normal is the mean curvature H times the unit normal N, so if the mean curvature is negative then the mean curvature normal H*N will point in the opposite direction of N.

I'm surprised there aren't more red dots.

discrete mean curvature can also be zero H=0. E.g., in the case of a flat one-ring around a vertex.

If you normalize a near zero-length mean curvature normal vector to get a unit length vector, then you'll just see a seemingly random vector that's determined by floating point error.

SuwoongHeo commented 6 years ago

@alecjacobson Thank you for your answer sir. My original problem is computing mesh normal using a linear operator. So I thought Laplacian with cotangent weight is a good approximation for this problem. I had computed the magnitude of mean curvature H from |L*V|. The minimum value of H was near 1e-09(The point I plotted above has H value of 1e-07). I think it is not in the range of floating point error.