fix: BoundBox exception when inserting BIM section plan into TechDraw. (#13153)

This commit is contained in:
Günther Eder
2024-03-26 11:23:55 +01:00
committed by GitHub
parent e7c0d969f4
commit 4845d391ed

View File

@@ -542,8 +542,10 @@ def getSVG(source,
# add additional edge symbols from windows
cutwindows = []
if cutface and windows:
cutwindows = [w.Name for w in windows if w.Shape.BoundBox.intersect(cutface.BoundBox)]
if cutface and windows and BoundBoxValid(cutface.BoundBox):
cutwindows = [
w.Name for w in windows if BoundBoxValid(w.Shape.BoundBox) and w.Shape.BoundBox.intersect(cutface.BoundBox)
]
if windows:
sh = []
for w in windows:
@@ -576,6 +578,11 @@ def getSVG(source,
return svg
def BoundBoxValid(boundBox)->bool:
"""Return true if boundBox has a non-zero volume"""
return boundBox.XLength > 0 and boundBox.YLength > 0 and boundBox.ZLength > 0
def getDXF(obj):
"""Return a DXF representation from a TechDraw view."""
allOn = getattr(obj, "AllOn", True)