Several implementations of calculating mean, gaussian, and normal surface curvature along with principal curvature and respective directions.
The functions allow the surface to be defined either symbolically (with sympy) or discretely. You can of course take a discrete surface and fit a polynomial to the data to create a symbolic expression of the surface. Or vice-vera, by taking a symbolic function and picking out a set of data points along the surface to use for discrete evaluation.
The data can be either explicit z = f(x,y)
or parametric (u,v) --> < x(uv), y(u,v), z(u,v) >
There is yet another way to define a surface, implicitly F(x,y,z) = 0
, but I have not created the functions for it yet.
These are most likely not the fastest or optimized ways to do the calculations, instead, they are meant to be a medium to learn differential geometry and how the formulas are implemented into computer code.
example/DiffGeoOps.ipynb
This project is managed by rye.
python -m unittest discover .\tests\
Curvedness = sqrt((k1**2 + k2**2)/2)
2004 Caltech Paper over Discrete Surface Curvature approach
2004 Princeton Paper for "Estimating Curvatures and Their Derivatives on Triangle Meshes"
Keenan Crane
2010 Panozzo - Quadratic Fitting
2021
https://github.com/alecjacobson/geometry-processing-curvature (See 2010 Panozzo)
https://github.com/cuge1995/curvature-calculation-python/blob/main/plcurvature.py
https://jhavaldar.github.io/assets/2017-07-16-diffgeo-notes5.pdf
https://github.com/pmp-library/pmp-library/blob/main/src/pmp/algorithms/curvature.cpp
https://booksite.elsevier.com/samplechapters/9780120887354/9780120887354.PDF