diff --git a/src/Mod/Arch/importIFC.py b/src/Mod/Arch/importIFC.py index 23fc52ae45..57f530837f 100644 --- a/src/Mod/Arch/importIFC.py +++ b/src/Mod/Arch/importIFC.py @@ -837,6 +837,11 @@ def insert(filename,docname,skip=[],only=[],root=None,preferences=None): project = product.Decomposes[0].RelatingObject modelRC = next((rc for rc in project.RepresentationContexts if rc.ContextType == "Model"), None) if modelRC and modelRC.TrueNorth: + # If the y-part of TrueNorth is 0, then the x-part should be checked. + # Declination would be -90° if x >0 and +90° if x < 0 + # Only if x==0 then we can not determine TrueNorth. + # But that would actually be an invalid IFC file, because the magnitude + # of the (twodimensional) direction vector for TrueNorth shall be greater than zero. (x, y) = modelRC.TrueNorth.DirectionRatios[:2] obj.Declination = ((math.degrees(math.atan2(y,x))-90+180)%360)-180 if (FreeCAD.GuiUp):