Fixed bug in Draft upgrade
This commit is contained in:
parent
55d6a85216
commit
ab7c176f42
|
@ -293,7 +293,7 @@ def formatObject(target,origin=None):
|
||||||
else:
|
else:
|
||||||
matchrep = origin.ViewObject
|
matchrep = origin.ViewObject
|
||||||
for p in matchrep.PropertiesList:
|
for p in matchrep.PropertiesList:
|
||||||
if not p in ["DisplayMode","BoundingBox","Proxy","RootNode"]:
|
if not p in ["DisplayMode","BoundingBox","Proxy","RootNode","Visibility"]:
|
||||||
if p in obrep.PropertiesList:
|
if p in obrep.PropertiesList:
|
||||||
val = getattr(matchrep,p)
|
val = getattr(matchrep,p)
|
||||||
setattr(obrep,p,val)
|
setattr(obrep,p,val)
|
||||||
|
@ -747,11 +747,25 @@ def fuse(object1,object2):
|
||||||
coplanar, a special Draft Wire is used, otherwise we use
|
coplanar, a special Draft Wire is used, otherwise we use
|
||||||
a standard Part fuse.'''
|
a standard Part fuse.'''
|
||||||
from draftlibs import fcgeo
|
from draftlibs import fcgeo
|
||||||
if fcgeo.isCoplanar(object1.Shape.fuse(object2.Shape).Faces):
|
import Part
|
||||||
|
# testing if we have holes:
|
||||||
|
holes = False
|
||||||
|
fshape = object1.Shape.fuse(object2.Shape)
|
||||||
|
for f in fshape.Faces:
|
||||||
|
if len(f.Wires) > 1:
|
||||||
|
holes = True
|
||||||
|
if fcgeo.isCoplanar(object1.Shape.fuse(object2.Shape).Faces) and not holes:
|
||||||
obj = FreeCAD.ActiveDocument.addObject("Part::Part2DObjectPython","Fusion")
|
obj = FreeCAD.ActiveDocument.addObject("Part::Part2DObjectPython","Fusion")
|
||||||
_Wire(obj)
|
_Wire(obj)
|
||||||
if gui:
|
if gui:
|
||||||
_ViewProviderWire(obj.ViewObject)
|
_ViewProviderWire(obj.ViewObject)
|
||||||
|
obj.Base = object1
|
||||||
|
obj.Tool = object2
|
||||||
|
elif holes:
|
||||||
|
# temporary hack, since Part::Fuse objects don't remove splitters
|
||||||
|
fshape = fshape.removeSplitter()
|
||||||
|
obj = FreeCAD.ActiveDocument.addObject("Part::Feature","Fusion")
|
||||||
|
obj.Shape = fshape
|
||||||
else:
|
else:
|
||||||
obj = FreeCAD.ActiveDocument.addObject("Part::Fuse","Fusion")
|
obj = FreeCAD.ActiveDocument.addObject("Part::Fuse","Fusion")
|
||||||
obj.Base = object1
|
obj.Base = object1
|
||||||
|
|
Loading…
Reference in New Issue
Block a user