From 278e7f9f1b687b6b7dc4bee75748d0380cd309f5 Mon Sep 17 00:00:00 2001 From: Ziyi KE Date: Fri, 19 May 2023 15:40:07 +0800 Subject: [PATCH] Fixed regression in processing IfcEdgeCurve with same EdgeStart and EdgeEnd --- Xbim.Geometry.Engine/XbimCompound.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Xbim.Geometry.Engine/XbimCompound.cpp b/Xbim.Geometry.Engine/XbimCompound.cpp index 1e8662aef..66c6fa9b9 100644 --- a/Xbim.Geometry.Engine/XbimCompound.cpp +++ b/Xbim.Geometry.Engine/XbimCompound.cpp @@ -830,6 +830,17 @@ namespace Xbim builder.UpdateVertex(endVertex, trim2Tolerance); BRepBuilderAPI_MakeEdge edgeMaker(sharedEdgeGeom, startVertex, endVertex, trimParam1, trimParam2); + /// in current official IFC documentation, the start and end can be the same, hence resulting the curve not getting trimmed + /// see https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2_TC1/HTML/schema/ifctopologyresource/lexical/ifcedge.htm + /// in "Attribute Definitions", for param 2 "EdgeEnd": The same vertex can be used for both EdgeStart and EdgeEnd. + /// this appears to be a regression comparing to older versions of this function (InitAdvancedFaces) + /// which uses XbimEdge to do the trimming and handled this situation + /// + /// the fix: here we simply do not pass the trimming params to the edgeMaker and everything goes one just fine + if (foundP1 && foundP2 && trimParam1 == trimParam2) + { + edgeMaker = BRepBuilderAPI_MakeEdge(sharedEdgeGeom); + } if (!edgeMaker.IsDone()) { BRepBuilderAPI_EdgeError err = edgeMaker.Error(); @@ -2095,4 +2106,4 @@ namespace Xbim } -} \ No newline at end of file +}