Code covered by the BSD License  

Highlights from
Patch Curvature

4.0

4.0 | 4 ratings Rate this file 47 Downloads (last 30 days) File Size: 314 KB File ID: #32573
image thumbnail

Patch Curvature

by

 

18 Aug 2011 (Updated )

Principal, Gaussian and Mean Curvature of triangulated mesh

| Watch this File

File Information
Description

  This function calculates the principal curvature directions and values
  of a triangulated mesh.
 
  The function first rotates the data so the normal of the current
  vertex becomes [-1 0 0], so we can describe the data by XY instead of
  XYZ.
  Secondly it fits a least-squares quadratic patch to the local
  neighborhood of a vertex "f(x,y) = ax^2 + by^2 + cxy + dx + ey + f".
  Then the eigenvectors and eigenvalues of the hessian are used to
  calculate the principal, mean and gaussian curvature.
 
  [Cmean,Cgaussian,Dir1,Dir2,Lambda1,Lambda2]=patchcurvature(FV,usethird)
 
  inputs,
    FV : A triangulated mesh (see Patch)
    usethird : Use third order neighbour vertices for the curvature
               fit, making it smoother but less local. true/ false (default)
 
  outputs,
    Cmean : Mean Curvature
    Cgaussian : Gaussian Curvature
    Dir1 : XYZ Direction of first Principal component
    Dir2 : XYZ Direction of second Principal component
    Lambda1 : value of first Principal component
    Lambda2 : value of second Principal component
 

MATLAB release MATLAB 7.12 (R2011a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (6)
15 Jan 2014 Binhang

This version seems much better!

15 Jan 2014 Dirk-Jan Kroon

* Binhang
Thank you, there was a bug which I solved by removing abs from the eigenvalues. This version will probably be online in one or two days.

13 Jan 2014 Binhang

Dear author, I have a question for the result.

Have you ever test your code for the torus? Did you notice that all the values for gauss and mean curvature are positive?

Well, I think this is incorrect.

06 Apr 2013 baziham  
06 Mar 2012 SABYASACHI DASGUPTA

Dear Mr.Kroon ,
Is it possible that you include how to calculate squared mean curvature over the mesh .
Regards,
Sabya

10 Jan 2012 Jonathan Sullivan

Great submission. Very help. Nice examples provided too!

Updates
15 Jan 2014

Fixed eigenvector calculation, sign of eigenvalues and sorting of eigenvectors

Contact us