From: gka Date: Mon, 12 Mar 2018 09:34:09 +0000 (+0300) Subject: 0029159: Sewing fail when using a maximum tolerance X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=0bded24d8cbcffb438a66e4321840c013334743e;p=occt-copy.git 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. --- 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); } }