- weight = 1
- if len(f.get_edge(fv[0], fv[1]).faces)==1:
- weight += 1
- if len(f.get_edge(fv[0], fv[-1]).faces)==1:
- weight += 1
- v.normal += f.normal*edge1.angle(edge2)*weight
- v.normal.normalize()
+ if edge1.length and edge2.length:
+ weight = 1
+ if len(f.get_edge(fv[0], fv[1]).faces)==1:
+ weight += 1
+ if len(f.get_edge(fv[0], fv[-1]).faces)==1:
+ weight += 1
+ v.normal += f.normal*edge1.angle(edge2)*weight
+ if v.normal.length:
+ v.normal.normalize()
+ else:
+ v.normal = mathutils.Vector((0, 0, 1))