From f76be90c59413bb65070bc135f008f081be82e57 Mon Sep 17 00:00:00 2001 From: balrobs <73989799+balrobs@users.noreply.github.com> Date: Thu, 10 Jun 2021 15:40:49 +0200 Subject: [PATCH] Bug fix for PointConnections of StructuralCurvedMembers this fixes a bug (indention problem) that prevented che correct generation of PointConnections for StructuralCurvedMembers (beams/columns) with coincident nodes. See: https://forum.freecadweb.org/viewtopic.php?f=39&t=54286&start=40#p509233 --- src/Mod/Arch/exportIFCStructuralTools.py | 58 ++++++++++++------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/src/Mod/Arch/exportIFCStructuralTools.py b/src/Mod/Arch/exportIFCStructuralTools.py index b3f415c4e2..a154aa05d8 100644 --- a/src/Mod/Arch/exportIFCStructuralTools.py +++ b/src/Mod/Arch/exportIFCStructuralTools.py @@ -258,38 +258,38 @@ def createStructuralMember(ifcfile, ifcbin, obj): structuralMember = ifcfile.createIfcStructuralSurfaceMember( uid(), ownerHistory, obj.Label, None, None, localPlacement, prodDefShape, "SHELL", thickness) - # check for existing connection nodes - for vert in verts: - vertCoord = tuple(vert) - if vertCoord in structural_nodes: - if structural_nodes[vertCoord]: - # there is already another member using this point - structPntConn = structural_nodes[vertCoord] - else: - # there is another member with same point, create a new node connection - structPntConn = createStructuralNode(ifcfile, ifcbin, vert) - structural_nodes[vertCoord] = structPntConn - ifcfile.createIfcRelConnectsStructuralMember( - uid(), ownerHistory, None, None, structuralMember, structPntConn, None, None, None, None) + # check for existing connection nodes + for vert in verts: + vertCoord = tuple(vert) + if vertCoord in structural_nodes: + if structural_nodes[vertCoord]: + # there is already another member using this point + structPntConn = structural_nodes[vertCoord] else: - # just add the point, no other member using it yet - structural_nodes[vertCoord] = None + # there is another member with same point, create a new node connection + structPntConn = createStructuralNode(ifcfile, ifcbin, vert) + structural_nodes[vertCoord] = structPntConn + ifcfile.createIfcRelConnectsStructuralMember( + uid(), ownerHistory, None, None, structuralMember, structPntConn, None, None, None, None) + else: + # just add the point, no other member using it yet + structural_nodes[vertCoord] = None - # check for existing connection curves - for edge in edges: - if edge in structural_curves: - if structural_curves[edge]: - # there is already another member using this curve - strucCrvConn = structural_curves[edge] - else: - # there is another member with same edge, create a new curve connection - strucCrvConn = createStructuralCurve(ifcfile, ifcbin, edge) - structural_curves[edge] = strucCrvConn - ifcfile.createIfcRelConnectsStructuralMember( - uid(), None, None, None, structuralMember, strucCrvConn, None, None, None, None) + # check for existing connection curves + for edge in edges: + if edge in structural_curves: + if structural_curves[edge]: + # there is already another member using this curve + strucCrvConn = structural_curves[edge] else: - # just add the curve, no other member using it yet - structural_curves[edge] = None + # there is another member with same edge, create a new curve connection + strucCrvConn = createStructuralCurve(ifcfile, ifcbin, edge) + structural_curves[edge] = strucCrvConn + ifcfile.createIfcRelConnectsStructuralMember( + uid(), None, None, None, structuralMember, strucCrvConn, None, None, None, None) + else: + # just add the curve, no other member using it yet + structural_curves[edge] = None return structuralMember