From 32f089f28408479ce65a22a753bb815ffe3d45ed Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Thu, 10 May 2018 16:32:43 -0300 Subject: [PATCH] Arch: optimizing block walls --- src/Mod/Arch/ArchWall.py | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/Mod/Arch/ArchWall.py b/src/Mod/Arch/ArchWall.py index 9c878468a1..a487c660c7 100644 --- a/src/Mod/Arch/ArchWall.py +++ b/src/Mod/Arch/ArchWall.py @@ -515,6 +515,7 @@ class _Wall(ArchComponent.Component): # blocks calculation elif hasattr(obj,"MakeBlocks") and hasattr(self,"basewires"): if obj.MakeBlocks and self.basewires and extdata and obj.Width and obj.BlockLength.Value and obj.BlockHeight.Value: + #print "calculating blocks" if len(self.basewires) == 1: blocks = [] n = FreeCAD.Vector(extv) @@ -608,17 +609,18 @@ class _Wall(ArchComponent.Component): # count blocks if hasattr(obj,"MakeBlocks"): - fvol = obj.BlockLength.Value * obj.BlockHeight.Value * obj.Width.Value - if fvol: - print("base volume:",fvol) - for s in base.Solids: - print(abs(s.Volume - fvol)) - ents = [s for s in base.Solids if abs(s.Volume - fvol) < 1] - obj.CountEntire = len(ents) - obj.CountBroken = len(base.Solids) - len(ents) - else: - obj.CountEntire = 0 - obj.CountBroken = 0 + if obj.MakeBlocks: + fvol = obj.BlockLength.Value * obj.BlockHeight.Value * obj.Width.Value + if fvol: + #print("base volume:",fvol) + #for s in base.Solids: + #print(abs(s.Volume - fvol)) + ents = [s for s in base.Solids if abs(s.Volume - fvol) < 1] + obj.CountEntire = len(ents) + obj.CountBroken = len(base.Solids) - len(ents) + else: + obj.CountEntire = 0 + obj.CountBroken = 0 # set the length property if obj.Base: