From 47125d8fda8c396f4d780eae735d4d209c43f436 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Mon, 30 May 2022 10:36:05 +0200 Subject: [PATCH] Arch: Fixed position of rectangles in IFC export --- src/Mod/Arch/exportIFC.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Mod/Arch/exportIFC.py b/src/Mod/Arch/exportIFC.py index 63859be41f..687c06684c 100644 --- a/src/Mod/Arch/exportIFC.py +++ b/src/Mod/Arch/exportIFC.py @@ -1944,9 +1944,14 @@ def getProfile(ifcfile,p): d = vec(p.Edges[0]) d.normalize() pxvc = ifcbin.createIfcDirection(tuple(d)[:2]) - povc = ifcbin.createIfcCartesianPoint((0.0,0.0)) # profile must be located at (0,0) because placement gets added later - #povc = ifcbin.createIfcCartesianPoint(tuple(p.CenterOfMass[:2])) + # povc = ifcbin.createIfcCartesianPoint((0.0,0.0)) + # the above statement appears wrong, so the line below has been uncommented for now + # TODO we must sort this out at some point... For now the line below seems to work + if getattr(p,"CenterOfMass",None): + povc = ifcbin.createIfcCartesianPoint(tuple(p.CenterOfMass[:2])) + else: + povc = ifcbin.createIfcCartesianPoint((0.0,0.0)) pt = ifcbin.createIfcAxis2Placement2D(povc,pxvc) #semiPerimeter = p.Length/2 #diff = math.sqrt(semiPerimeter**2 - 4*p.Area)