File Exchange

image thumbnail

Curvature Estimationl On triangle mesh

version (8.87 KB) by Itzik Ben Shabat
Computes curvature and curvature derivative tensors in each vertex of a triangle meshes


Updated 22 Oct 2018

View Version History

View License

If you use it for academic purposes please cite :
1. "Estimating Curvatures and Their Derivatives on Triangle Meshes" by Szymon Rusinkiewicz (2004)
2. Y. Ben Shabat, A. Fischer, "Design of Adaptive Porous Micro-structures using curvature analysis for Additive Manufacturing" the 25th CIRP Design conference. 2015, Haifa, Israel.
This code was implemented according to [1].

GetCurvatures computes the curvature tensor and the principal curvatures at
%each vertex of a mesh given in a face vertex data structure
-FV -struct - Triangle mesh face vertex data structure (containing FV.face and
-toggleDerivatives - scalar 1 or 0 indicating whether or not to calculate curvature derivatives
-PrincipalCurvatures - 2XN matrix (where N is the number of vertices containing the principal curvatures k1 and k2 at each vertex
-PrincipalDir1 - NX3 matrix containing the direction of the k1 principal
-PrincipalDir2 - NX3 matrix containing the direction of the k2 principal curvature.
-FaceCMatrix - 4XM matrix (where M is the number of faces) containing the 4
%coefficients of the curvature tensr of each face
VertexCMatrix- 4XN matrix (where M is the number of faces) containing the 4 coefficients of the curvature tensor of each tensor.
-Cmagnitude - NX1 matrix containing the square sum of the curvature tensor coefficients at each vertex (invariant scalar indicating the change of curvature)

Cite As

Rusinkiewicz, S. “Estimating Curvatures and Their Derivatives on Triangle Meshes.” Proceedings. 2nd International Symposium on 3D Data Processing, Visualization and Transmission, 2004. 3DPVT 2004., IEEE, doi:10.1109/tdpvt.2004.1335277.

View more styles

Shabat, Yizhak Ben, and Anath Fischer. “Design of Porous Micro-Structures Using Curvature Analysis for Additive-Manufacturing.” Procedia CIRP, vol. 36, Elsevier BV, 2015, pp. 279–84, doi:10.1016/j.procir.2015.01.057.

View more styles

Comments and Ratings (13)

Itzik Ben Shabat

Sorry for the delayed response. I am not getting updates when comments are posted (for some reason). You can visit my website for updates at or email me about the code to get faster response.
Regarding the comment about the citations: It appeared in the code text. Regardless, I also updated it in the Matlab central interface with the propper citations.

@filipp Regarding the neighborhood size question: It would be a major undertaking. The normals are computed per face and then per vertex weighted by the faces size. You could change CalcVertexNormals() to use additional vertices from larger neighborhoods.


Hi, I am still struggling with this - it is possible to change the size of the neighborhood by making changes to your code? Or is it a major undertaking so that I rather should look for some other robust curvature estimation code that allows for variations in neighborhood size? (Would be a shame as your code is up to now the most robust Matlab code that I found...). It woudl be great if you could answer me :-)


Great piece of code! I assume that you are using a 1-ring neighborhood as in the original paper to calculate curvatures. Would you be able to point out where in the code you can change the size of this neighborhood?

Rane Remi

Amirali Nojoomi

Alessandro Falchi

This code is very effective and efficient.

At first, I was struggling to compute the curvature on an imported ellipsoid .STL file. Just after a while, I realised that it was necessary to remove the duplicated vertices before the computation could've been performed properly.

Alessandro Falchi

David Nolan

Hi Itzik,

Any paper of your own that you would like people to cite for use of this function?


Itzik Ben Shabat

Thanks for the positive feedback,
regarding the estimation on a point cloud, this function is not the case. I know an implementation in PCL (Point Cloud Library) that performs PCA analysis on the covariance matrix of a neighborhood of points and takes the 2 larger eigen values (the smaller one is in the normal direction). However I do not know a MATLAB implementation.
Regarding the 4D data, again, i dont htink this is the function for you. i recommend consulting with the author of the original paper - Prof. Szymon Rusinkiewicz


This code is very effective and simple to use, nice work! Many thanks to the authors.

Mandeep Dhanda

Great work,

How do i estimate curvature on point cloud without fitting surface/mesh?

manuel FOSSA

Great addtion,

Can you functions work with 4D data? (x,y,time,scalar)

I can create a 3D triangular mesh and 4D vertices but the function GetCurvature throws an "Index exceeds matrix dimensions"

Gianni Schena

speed up with:





in CalcCurvature.m

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!