Arch: Small fixes around Arch and Draft

This commit is contained in:
Yorik van Havre
2014-02-26 18:01:24 -03:00
parent 0b0a57a4eb
commit 48d63f8020
6 changed files with 60 additions and 41 deletions

View File

@@ -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: