Skip to content

Commit

Permalink
[ArchWindow] getSubVolume() Bug - When HoleDepth is set but the Windo…
Browse files Browse the repository at this point in the history
…w is a Clone, no opening is created

getSubVolume() -

- When Windown is a Clone, no base is set
- When HoleDepth is set, no further check if there is a Clone to set its base to Clone's base
- The original code return None when no base is set
  • Loading branch information
paullee0 authored and yorikvanhavre committed Jan 22, 2020
1 parent a322eff commit 98dfa25
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/Mod/Arch/ArchWindow.py
Expand Up @@ -1309,21 +1309,22 @@ def getSubVolume(self,obj,plac=None):
if obj.Base:
base = obj.Base
width = 0
if hasattr(obj,"HoleDepth"):
if hasattr(obj,"HoleDepth"): # the code have not checked whether this is a clone and use the original's HoleDepth; if HoleDepth is set in this object, even it is a clone, the original's HoleDepth is overridden
if obj.HoleDepth.Value:
width = obj.HoleDepth.Value
if not width:
if base:
b = base.Shape.BoundBox
width = max(b.XLength,b.YLength,b.ZLength)
if not width:
if Draft.isClone(obj,"Window"):
if Draft.isClone(obj,"Window"): # check whether this is a clone and use the original's HoleDepth or Shape's Boundbox
if hasattr(obj,"CloneOf"):
orig = obj.CloneOf
else:
orig = obj.Objects[0]
if orig.Base:
base = orig.Base

if hasattr(orig,"HoleDepth"):
if orig.HoleDepth.Value:
width = orig.HoleDepth.Value
Expand All @@ -1333,8 +1334,17 @@ def getSubVolume(self,obj,plac=None):
width = max(b.XLength,b.YLength,b.ZLength)
if not width:
width = 1.1112 # some weird value to have little chance to overlap with an existing face

if not base:
return None
if Draft.isClone(obj,"Window"): # if this object has not base, check whether this is a clone and use the original's base
if hasattr(obj,"CloneOf"):
orig = obj.CloneOf
else:
orig = obj.Objects[0] # not sure what is this exactly
if orig.Base:
base = orig.Base
else:
return None

# finding which wire to use to drill the hole

Expand Down

0 comments on commit 98dfa25

Please sign in to comment.