move Placement.isNull to Placement.isIdentity

add isNull for backward compatibility
This commit is contained in:
wmayer
2017-12-13 19:13:18 +01:00
parent b22f231345
commit 0d7831e196
3 changed files with 18 additions and 6 deletions

View File

@@ -491,7 +491,7 @@ class Component:
#print("Processing subshapes of ",obj.Label, " : ",obj.Additions)
if placement:
if placement.isNull():
if placement.isIdentity():
placement = None
else:
placement = FreeCAD.Placement(placement)
@@ -625,19 +625,19 @@ class Component:
else:
shape = r
obj.Shape = self.spread(obj,shape,placement)
if not placement.isNull():
if not placement.isIdentity():
obj.Placement = placement
else:
if allownosolid:
obj.Shape = self.spread(obj,shape,placement)
if not placement.isNull():
if not placement.isIdentity():
obj.Placement = placement
else:
FreeCAD.Console.PrintWarning(obj.Label + " " + translate("Arch","has no solid")+"\n")
else:
if allowinvalid:
obj.Shape = self.spread(obj,shape,placement)
if not placement.isNull():
if not placement.isIdentity():
obj.Placement = placement
else:
FreeCAD.Console.PrintWarning(obj.Label + " " + translate("Arch","has an invalid shape")+"\n")

View File

@@ -1212,7 +1212,7 @@ def getTuples(data,scale=1,placement=None,normal=None,close=True):
for v in verts:
pt = v.Point
if placement:
if not placement.isNull():
if not placement.isIdentity():
pt = placement.multVec(pt)
if rnd:
pt = DraftVecUtils.rounded(pt)