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
This commit is contained in:
balrobs
2021-06-10 15:40:49 +02:00
committed by Bernd Hahnebach
parent 4a9963a03f
commit f76be90c59

View File

@@ -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