Question

I have a problem of getting principal curvatures from a given mesh (of a shape).

  1. I am trying to use 'patchcurvature' method from Matlab file exchange. However, the method always given the positive curvatures. I think it might be that the method considered the mesh as separate patches, and calculate the principal curvatures for each patch. [~,~,Dir1,Dir2,PrincipalCurvature1,PrincipalCurvature1]=patchcurvature(meshFaceVertices);

  2. I also tried to use another method from Matlab file exchange called 'surfature'; however, it calculates the principal curvatures of a 'surface' defined by three 2D arrays of points on the surface. I am not sure how to create a 'surface' with 2D point arrays from a existing mesh defined by vertices and faces. There are some methods convert surface to mesh but not the other way around...

Any ideas would be appreciated. Thanks so much and Happy New Year!!!

Best, A.

Was it helpful?

Solution

Principal curvatures, if I am not missing a different definition, are defined on differentiable surfaces but meshes (usually a collection of triangles) are not differentiable. I can imagine some of possible approaches to approximate the principal curvatures.

Assuming that your mesh is obtained by sampling from a differentiable surface, what you need to do is polynomial regression, more specifically quadratic interpolation on the nearby vertices around the point you are trying to calculate curvature.

First you'll need to determine the normal vector at your point of interest. The normal vector can be obtained by the normal direction of a mesh triangle ( AB × AC , cross-producting two edges of a triangle), and interpolating with some other normal vectors.

Once you've found the normal vector, you can transform the coordinates of you mesh so that the point is at the origin and the normal vector is pointing the z axis. (with a parameter of rotating along z-axis by angle theta)

Then your next goal is to find a surface

     1                   1
z = --- alpha * x^2  +  --- beta * y^2
     2                   2

that best approximates your set of points, with three parameters alpha, beta and theta.

Then alpha and beta is the principal components.

I am not certain but there will already be a matlab function that does this regression for you.

OTHER TIPS

As an alternative to Iyomis answer that's maybe less specific for your problem but might be useful in the general case: You could compute a tangent plane, given your mesh with normals, at a given point, project the normals of neighboring vertices (or better an interpolation between the plane normal and the neighboring normals) onto that plane and then just use the principal component analysis on the resulting points.

Well, its not exactly what principal curvatures are, but its an ok approximation. I believe the pcl (http://pointclouds.org) library uses something similar for their principal curvature implementation.

why not doing it by definition, but descrete. meaning for Z where z is a meshgrid of XY decribing the surface hight.

[Fx,Fy] = gradient(Z);

[Fxx,~] = gradient(Fx);

[~,Fyy] = gradient(Fy);

curv_norm=abs(Fxx.*Fyy-Fxy.^2);

normeliztion_size_mat = (1+Fx.^2+Fy.^2).^2;

normelized_size_mat=curv_norm/normelization_size_mat;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top