Draft: fix rectangle with face offset bug

This commit is contained in:
Roy-043
2022-10-30 12:49:28 +01:00
parent 1282fdb7e8
commit c9233ecdce
3 changed files with 17 additions and 7 deletions

View File

@@ -72,9 +72,12 @@ def offset(obj, delta, copy=False, bind=False, sym=False, occ=False):
newwire = None
delete = None
if utils.get_type(obj).startswith("Part::") or utils.get_type(obj).startswith("Sketcher::"):
copy = True
if (copy is False
and (utils.get_type(obj).startswith("Sketcher::")
or utils.get_type(obj).startswith("Part::")
or utils.get_type(obj).startswith("PartDesign::"))): # For PartDesign_SubShapeBinders which can reference sketches.
print("the offset tool is currently unable to offset a non-Draft object directly - Creating a copy")
copy = True
def getRect(p,obj):
"""returns length,height,placement"""
@@ -199,7 +202,7 @@ def offset(obj, delta, copy=False, bind=False, sym=False, occ=False):
try:
if p:
newobj = make_wire(p)
newobj.Closed = obj.Shape.isClosed()
newobj.Closed = DraftGeomUtils.isReallyClosed(obj.Shape)
except Part.OCCError:
pass
if (not newobj) and newwire: