From 96cbc722f5df299b76f5686ab71a537f0a9c1167 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Sat, 22 May 2021 17:28:39 +0200 Subject: [PATCH] Arch: Simplify some ifs in ArchComponent This commit does not change behavior. --- src/Mod/Arch/ArchComponent.py | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/Mod/Arch/ArchComponent.py b/src/Mod/Arch/ArchComponent.py index a94396d6ae..a89be869a9 100644 --- a/src/Mod/Arch/ArchComponent.py +++ b/src/Mod/Arch/ArchComponent.py @@ -737,20 +737,18 @@ class Component(ArchIFC.IfcProduct): base = base.fuse(add) elif hasattr(o,'Shape'): - if o.Shape: - if not o.Shape.isNull(): - if o.Shape.Solids: - s = o.Shape.copy() - if placement: - s.Placement = s.Placement.multiply(placement) - if base: - if base.Solids: - try: - base = base.fuse(s) - except Part.OCCError: - print("Arch: unable to fuse object ", obj.Name, " with ", o.Name) - else: - base = s + if o.Shape and not o.Shape.isNull() and o.Shape.Solids: + s = o.Shape.copy() + if placement: + s.Placement = s.Placement.multiply(placement) + if base: + if base.Solids: + try: + base = base.fuse(s) + except Part.OCCError: + print("Arch: unable to fuse object ", obj.Name, " with ", o.Name) + else: + base = s # treat subtractions subs = obj.Subtractions @@ -1420,11 +1418,7 @@ class ViewProviderComponent: if hasattr(self,"Object"): c = [] if hasattr(self.Object,"Base"): - if Draft.getType(self.Object) != "Wall": - c = [self.Object.Base] - elif Draft.getType(self.Object.Base) == "Space": - c = [] - else: + if not (Draft.getType(self.Object) == "Wall" and Draft.getType(self.Object.Base) == "Space"): c = [self.Object.Base] if hasattr(self.Object,"Additions"): c.extend(self.Object.Additions)