Mathematical Principles for Scientific Computing and Visualization  
http://www.farinhansford.com/books/scv
by Gerald Farin and Dianne Hansford

This notebook demonstrates discrete Gaussian curvature for triangles meshes.
Discrete Gaussian curvature is measured by 2PI - sum of the angles around a vertex divided by the area of the star. (See Eq 13.6). Thus by looking at the sum of the angles around a vertex, we can categorize the Gaussian curvature as negative, zero, or positive. This point is illustrated in this notebook.

Exercise: Add calculation of Gaussian curvature to this notebook. Plus: animate the position of the "peak" point using the manipulate command.

Figure 13.9 and 13.10 were created with this notebook.

See Chapter 13: Facets for details.

Updated May 2008

(* Output results to folder that this file lives in *)

(SetDirectory[ToFileName[Extract["FileName"/.NotebookInformation[EvaluationNotebook[]],{1},FrontEnd`FileName]]];) 

(* Define a point set and triangulation (or mesh) *)
(* The "peak" point is at the center of the mesh *)

(pt1={0,0,0};) 
(pt2={1,0,1};) 
(pt3={3,1,-0.5`};) 
(pt4={2,3,1};)
 (pt5={0,2,-1};) 

(* This point creates negative Gaussian curvature *)
(peak={1,1,0};) 

(tri1=Graphics3D[Polygon[{pt1,pt2,peak}]];) (tri2=Graphics3D[Polygon[{pt2,pt3,peak}]];) (tri3=Graphics3D[Polygon[{pt3,pt4,peak}]];) (tri4=Graphics3D[Polygon[{pt4,pt5,peak}]];) (tri5=Graphics3D[Polygon[{pt5,pt1,peak}]];) 

(mesh1={tri1,tri2,tri3,tri4,tri5};) 

(* Plot the mesh *)

Print["This data set has negative Gaussian curvature at the center vertex"]
(pic=Show[mesh1,ViewPoint->{1,-1,1.5`},Boxed->False]) 

(* Create postscript output *)
Export["neg_curv.eps",pic]

(* This example has zero discrete Gaussian curvature *)


Clear[pt1, pt2, pt3, pt4, pt5];
Clear[tri1,tri2, tri3, tri4, tri5, tri5];
Clear[mesh1];
Clear[pic];


(* Define a point set and triangulation (or mesh) *)
(* The "peak" point is at the center of the mesh *)

(pt1={0,0,0};) 
(pt2={1,0,0};) 
(pt3={3,1,0};) 
(pt4={2,3,0};)
 (pt5={0,2,0};) 

(* This point creates negative Gaussian curvature *)
(peak={1,1,0};) 

(tri1=Graphics3D[Polygon[{pt1,pt2,peak}]];) (tri2=Graphics3D[Polygon[{pt2,pt3,peak}]];) (tri3=Graphics3D[Polygon[{pt3,pt4,peak}]];) (tri4=Graphics3D[Polygon[{pt4,pt5,peak}]];) (tri5=Graphics3D[Polygon[{pt5,pt1,peak}]];) 

(mesh1={tri1,tri2,tri3,tri4,tri5};) 

(* Plot the mesh *)

Print["This plot has zero Gaussian curvature at the center vertex"]
(pic=Show[mesh1,Boxed->False])

(* This example has positive discrete Gaussian curvature *)


Clear[pt1, pt2, pt3, pt4, pt5];
Clear[tri1,tri2, tri3, tri4, tri5, tri5];
Clear[mesh1];
Clear[pic];



(* Define a point set and triangulation (or mesh) *)
(* The "peak" point is at the center of the mesh *)

(pt1={0,0,1.3};) 
(pt2={1,0,1};) 
(pt3={3,1,1.5`};) 
(pt4={2,3,1.2};)
 (pt5={0,2,1};) 

(* This point creates negative Gaussian curvature *)
(peak={1,1,0};) 

(tri1=Graphics3D[Polygon[{pt1,pt2,peak}]];) (tri2=Graphics3D[Polygon[{pt2,pt3,peak}]];) (tri3=Graphics3D[Polygon[{pt3,pt4,peak}]];) (tri4=Graphics3D[Polygon[{pt4,pt5,peak}]];) (tri5=Graphics3D[Polygon[{pt5,pt1,peak}]];) 

(mesh1={tri1,tri2,tri3,tri4,tri5};) 

(* Plot the mesh *)

Print["This plot has positive Gaussian curvature at the center vertex"]
(pic=Show[mesh1,Boxed->False])