Draft: Make Facebinders link-aware (2nd error fix)

Previous PRs: #11081 and #11156.
This commit is contained in:
Roy-043
2023-10-25 18:16:43 +02:00
parent 61c1b2bfc2
commit 85ace1ca33

View File

@@ -104,25 +104,26 @@ class Facebinder(DraftObject):
else:
extr = face.makeOffsetShape(extr_val, 1e-7, fill=True)
extrs.extend(extr.Solids)
sh = extrs.pop()
shp = Part.Shape() # create empty shape to ensure default Placement
shp = shp.fuse(extrs.pop()) # add 1st shape, multiFuse does not work otherwise
if extrs:
sh = sh.multiFuse(extrs)
shp = shp.multiFuse(extrs) # multiFuse is more reliable than serial fuse
else:
sh = faces.pop()
shp = Part.Shape()
shp = shp.fuse(faces.pop())
if faces:
sh = sh.multiFuse(faces)
shp = shp.multiFuse(faces)
if len(faces) > 1:
if hasattr(obj, "Sew") and obj.Sew:
sh.sewShape()
shp.sewShape()
if not hasattr(obj, "RemoveSplitter"):
sh = sh.removeSplitter()
shp = shp.removeSplitter()
elif obj.RemoveSplitter:
sh = sh.removeSplitter()
shp = shp.removeSplitter()
except Part.OCCError:
print("Draft: error building facebinder")
return
obj.Shape = sh
obj.Placement = pl
obj.Shape = shp
obj.Area = area
self.props_changed_clear()