 # Curvature.Kappa questions

Hi,

It was my understanding that Surface.Curvature.Kappa(0) will return the highest found curvature and Kappa(1) the lowest.

So if I want to find the highest curvature and its direction on the surface I’d get Surface.Curvature.Kappa(0) and Surface.Curvature.Direction(0).

However this implementation gave me an unexpected result and looking at the documentation on Surface.Curvature I found the python example to imply that Kappa(0) will give curvature in U direction.
https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Geometry_SurfaceCurvature_Kappa.htm

the python example in question:

``````import rhinoscriptsyntax as rs

surface_id,_,_,_,_,_ = rs.GetSurfaceObject("Select surface for curvature measurement")
point = rs.GetPointOnSurface(surface_id,
"Select point on surface for curvature measurement")
u,v = rs.SurfaceClosestPoint(surface_id, point)

#point, normal, kappa_u, direction_u, kappa_v, direction_v, gaussian, mean =
surface_curvature = rs.SurfaceCurvature(surface_id, (u,v))

point, normal, kappa_u, direction_u, kappa_v, direction_v, gaussian, mean = surface_curvature

print "Surface curvature evaluation at parameter: ({0}, {1})".format(u,v)

print "  3-D Point: ({0}, {1}, {2})".format(point.X, point.Y, point.Z)

print "  3-D Normal: ({0}, {1}, {2})".format(normal.X, normal.Y, normal.Z)

print "  Maximum principal curvature: {0} ({1}, {2}, {3})".format(
kappa_u, direction_u.X, direction_u.Y, direction_u.Z)

print "  Minimum principal curvature: {0} ({1}, {2}, {3})".format(
kappa_v, direction_v.X, direction_v.Y, direction_v.Z)

print "  Gaussian curvature: {0}".format(gaussian)
print "  Mean curvature: {0}".format(mean)
``````

for reference the rhinoscriptsyntax method SurfaceCurvature():

``````def SurfaceCurvature(surface_id, parameter):
"""Returns the curvature of a surface at a U,V parameter. See Rhino help
for details of surface curvature
Parameters:
surface_id (guid): the surface's identifier
parameter (number, number): u,v parameter
Returns:
tuple(point, vector, number, number, number, number, number): of curvature information
   point at specified U,V parameter
   normal direction
   maximum principal curvature
   maximum principal curvature direction
   minimum principal curvature
   minimum principal curvature direction
   gaussian curvature
   mean curvature
None: if not successful, or on error
Example:
import rhinoscriptsyntax as rs
srf = rs.GetObject("Select a surface", rs.filter.surface)
if rs.IsSurface(srf):
point = rs.GetPointOnSurface(srf, "Pick a test point")
if point:
param = rs.SurfaceClosestPoint(srf, point)
if param:
data = rs.SurfaceCurvature(srf, param)
if data:
print "Surface curvature evaluation at parameter", param, ":"
print " 3-D Point:", data
print " 3-D Normal:", data
print " Maximum principal curvature:", data, " ", data
print " Minimum principal curvature:", data, " ", data
print " Gaussian curvature:", data
print " Mean curvature:", data