From 0bded24d8cbcffb438a66e4321840c013334743e Mon Sep 17 00:00:00 2001 From: gka Date: Mon, 12 Mar 2018 12:34:09 +0300 Subject: [PATCH] 0029159: Sewing fail when using a maximum tolerance Patch for OCCT670. Computed tolerance of the edge is set directly in the TEdge if value of computed maximal distance between 3D curve and curve on the surface less then tolerance of edge computed in the SameParameter method. --- src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx index 61ae9ac514..d63db49d88 100644 --- a/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx +++ b/src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx @@ -124,6 +124,7 @@ #include #include #include +#include //======================================================================= //function : SameRange @@ -934,11 +935,25 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs if (dist > dist2) dist2 = dist; } - maxTol = Max(sqrt(dist2), Precision::Confusion()); + maxTol = Max(sqrt(dist2) * (1. + 1e-7), Precision::Confusion()); + //maxTol = Max(sqrt(dist2), Precision::Confusion()); } } + if(maxTol >= 0. && maxTol < tolReached) + { + if (tolReached > MaxTolerance()) + { + // Set tolerance directly to overwrite too large tolerance + static_cast(edge.TShape().operator->())->Tolerance(maxTol); + } + else + { + // just update tolerance with computed distance aBuilder.UpdateEdge(edge, maxTol); + } + } + aBuilder.SameParameter(edge,Standard_True); } } -- 2.39.5