Hi, as the title says, I’m having some issues with mathutils.geometry.normal(). For testing purposes I have a simple plane in an otherwise empty blend file. When I run this code
import mathutils import bpy verts = [vertex.co for vertex in bpy.data.objects['Plane'].data.vertices] for i in range(len(verts)): verts[i] = bpy.data.objects['Plane'].matrix_world * verts[i] normal = mathutils.geometry.normal(verts) print ("Position:") print (bpy.data.objects['Plane'].location) print ("Rotation:") print (bpy.data.objects['Plane'].rotation_euler) print ("Normal vector:") print (normal)
I am getting normal vectors which are (0,0,0).
Position: Rotation: Normal vector:
I tried moving the plane around and rotating it and the only position where I got something else than (0, 0, 0) was this one:
Position: Rotation: Normal vector:
I also tried this on another computer and got different results (for the same positions), sometimes even NaN. I tried this using 2.7.6. I also noticed there was a change in normal() somewhat recently as in 2.7.3. normal() takes exactly 4 arguments and no lists. Am I doing something wrong or is there a bug in mathutils?