Arch: Small fixes around Arch and Draft
This commit is contained in:
@@ -330,7 +330,7 @@ class Component:
|
||||
|
||||
def processSubShapes(self,obj,base,pl=None):
|
||||
"Adds additions and subtractions to a base shape"
|
||||
import Draft
|
||||
import Draft,Part
|
||||
|
||||
if pl:
|
||||
if pl.isNull():
|
||||
@@ -345,36 +345,40 @@ class Component:
|
||||
if base:
|
||||
if base.isNull():
|
||||
base = None
|
||||
|
||||
# special case, both walls with coinciding endpoints
|
||||
import ArchWall
|
||||
js = ArchWall.mergeShapes(o,obj)
|
||||
if js:
|
||||
add = js.cut(base)
|
||||
if pl:
|
||||
add.Placement = add.Placement.multiply(pl)
|
||||
base = base.fuse(add)
|
||||
|
||||
elif (Draft.getType(o) == "Window") or (Draft.isClone(o,"Window")):
|
||||
f = o.Proxy.getSubVolume(o)
|
||||
if f:
|
||||
if base.Solids and f.Solids:
|
||||
if pl:
|
||||
f.Placement = f.Placement.multiply(pl)
|
||||
base = base.cut(f)
|
||||
|
||||
elif o.isDerivedFrom("Part::Feature"):
|
||||
if o.Shape:
|
||||
if not o.Shape.isNull():
|
||||
if o.Shape.Solids:
|
||||
s = o.Shape.copy()
|
||||
if base:
|
||||
# special case, both walls with coinciding endpoints
|
||||
import ArchWall
|
||||
js = ArchWall.mergeShapes(o,obj)
|
||||
if js:
|
||||
add = js.cut(base)
|
||||
if pl:
|
||||
add.Placement = add.Placement.multiply(pl)
|
||||
base = base.fuse(add)
|
||||
|
||||
elif (Draft.getType(o) == "Window") or (Draft.isClone(o,"Window")):
|
||||
f = o.Proxy.getSubVolume(o)
|
||||
if f:
|
||||
if base.Solids and f.Solids:
|
||||
if pl:
|
||||
s.Placement = s.Placement.multiply(pl)
|
||||
if base:
|
||||
if base.Solids:
|
||||
base = base.fuse(s)
|
||||
else:
|
||||
base = s
|
||||
f.Placement = f.Placement.multiply(pl)
|
||||
base = base.cut(f)
|
||||
|
||||
elif o.isDerivedFrom("Part::Feature"):
|
||||
if o.Shape:
|
||||
if not o.Shape.isNull():
|
||||
if o.Shape.Solids:
|
||||
s = o.Shape.copy()
|
||||
if pl:
|
||||
s.Placement = s.Placement.multiply(pl)
|
||||
if base:
|
||||
if base.Solids:
|
||||
try:
|
||||
base = base.fuse(s)
|
||||
except:
|
||||
print "Arch: unable to fuse object ",obj.Name, " with ", o.Name
|
||||
else:
|
||||
base = s
|
||||
|
||||
# treat subtractions
|
||||
for o in obj.Subtractions:
|
||||
@@ -407,7 +411,10 @@ class Component:
|
||||
s = o.Shape.copy()
|
||||
if pl:
|
||||
s.Placement = s.Placement.multiply(pl)
|
||||
base = base.cut(s)
|
||||
try:
|
||||
base = base.cut(s)
|
||||
except:
|
||||
print "Arch: unable to cut object ",o.Name, " from ", obj.Name
|
||||
return base
|
||||
|
||||
class ViewProviderComponent:
|
||||
|
||||
Reference in New Issue
Block a user