Fixing connection error for structural surface members
This changes improve connections between structural surface members with coincident edges See forum: https://forum.freecadweb.org/viewtopic.php?f=39&t=54286&p=509311#p509311
This commit is contained in:
@@ -139,7 +139,7 @@ def createStructuralMember(ifcfile, ifcbin, obj):
|
||||
|
||||
"""Creates a structural member if possible. Returns the member"""
|
||||
|
||||
global structural_nodes
|
||||
global structural_nodes, structural_curves
|
||||
structuralMember = None
|
||||
import Draft
|
||||
import Part
|
||||
@@ -277,19 +277,29 @@ def createStructuralMember(ifcfile, ifcbin, obj):
|
||||
|
||||
# check for existing connection curves
|
||||
for edge in edges:
|
||||
if edge in structural_curves:
|
||||
if structural_curves[edge]:
|
||||
verts12 = tuple([edge.Vertexes[ 0].Point.x, edge.Vertexes[ 0].Point.y, edge.Vertexes[ 0].Point.z,
|
||||
edge.Vertexes[-1].Point.x, edge.Vertexes[-1].Point.y, edge.Vertexes[-1].Point.z])
|
||||
verts21 = tuple([edge.Vertexes[-1].Point.x, edge.Vertexes[-1].Point.y, edge.Vertexes[-1].Point.z,
|
||||
edge.Vertexes[ 0].Point.x, edge.Vertexes[ 0].Point.y, edge.Vertexes[ 0].Point.z])
|
||||
verts12_in_curves = verts12 in structural_curves
|
||||
verts21_in_curves = verts21 in structural_curves
|
||||
if verts21_in_curves:
|
||||
verts = verts21
|
||||
else:
|
||||
verts = verts12
|
||||
if (verts12_in_curves or verts21_in_curves):
|
||||
if structural_curves[verts]:
|
||||
# there is already another member using this curve
|
||||
strucCrvConn = structural_curves[edge]
|
||||
strucCrvConn = structural_curves[verts]
|
||||
else:
|
||||
# there is another member with same edge, create a new curve connection
|
||||
strucCrvConn = createStructuralCurve(ifcfile, ifcbin, edge)
|
||||
structural_curves[edge] = strucCrvConn
|
||||
structural_curves[verts] = 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
|
||||
structural_curves[verts] = None
|
||||
return structuralMember
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user