I’m calling rs.SurfaceCurvature() in python to obtain the surface normal vector at a particular point at a surface. After rendering the normal vector (see code below), the normal vector seems to be always pointing in the same direction, even if the surface is flipped via the command “dir” or its python equivalent. The vector is definitely normal to the surface, but it does not particularly point in the correct direction…
@stevebaer, is this the expected behavior? Or is this a bug?
import rhinoscriptsyntax as rs srf = rs.GetObject("Select a surface", rs.filter.surface) def renderVector(vecdir, base_point): tip_point = rs.PointAdd(base_point, vecdir) line = rs.AddLine(base_point, tip_point) if line: return rs.CurveArrows(line, 2) 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 renderVector(data, data)
I don’t know if this is pertinent info, but the particular surface that I’m observing this was created with 4 edges using rs.AddEdgeSrf().