Draft: Minor bugfixes in wire flattening code

This commit is contained in:
Yorik van Havre 2016-12-01 14:42:51 -02:00
parent 04a56fbceb
commit fcd0465d8f
2 changed files with 6 additions and 2 deletions

View File

@ -1101,6 +1101,8 @@ def getNormal(shape):
vdir = Draft.get3DView().getViewDirection()
if n.getAngle(vdir) < 0.78:
n = n.negative()
if not n.Length:
return None
return n
def getRotation(v1,v2=FreeCAD.Vector(0,0,1)):

View File

@ -123,10 +123,12 @@ class plane:
self.doc = FreeCAD.ActiveDocument
self.axis = axis;
self.axis.normalize()
if (DraftVecUtils.equals(axis, Vector(1,0,0))):
if axis.getAngle(Vector(1,0,0)) < 0.00001:
self.axis = Vector(1,0,0)
self.u = Vector(0,1,0)
self.v = Vector(0,0,1)
elif (DraftVecUtils.equals(axis, Vector(-1,0,0))):
elif axis.getAngle(Vector(-1,0,0)) < 0.00001:
self.axos = Vector(-1,0,0)
self.u = Vector(0,-1,0)
self.v = Vector(0,0,1)
elif upvec: