1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

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.
This commit is contained in:
gka
2018-03-12 12:34:09 +03:00
parent 5cbd484b7d
commit 0bded24d8c

View File

@@ -124,6 +124,7 @@
#include <BRepBuilderAPI_CellFilter.hxx> #include <BRepBuilderAPI_CellFilter.hxx>
#include <BRepBuilderAPI_BndBoxTreeSelector.hxx> #include <BRepBuilderAPI_BndBoxTreeSelector.hxx>
#include <NCollection_UBTreeFiller.hxx> #include <NCollection_UBTreeFiller.hxx>
#include <BRep_TEdge.hxx>
//======================================================================= //=======================================================================
//function : SameRange //function : SameRange
@@ -934,11 +935,25 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs
if (dist > dist2) if (dist > dist2)
dist2 = dist; 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(maxTol >= 0. && maxTol < tolReached)
{
if (tolReached > MaxTolerance())
{
// Set tolerance directly to overwrite too large tolerance
static_cast<BRep_TEdge*>(edge.TShape().operator->())->Tolerance(maxTol);
}
else
{
// just update tolerance with computed distance
aBuilder.UpdateEdge(edge, maxTol); aBuilder.UpdateEdge(edge, maxTol);
}
}
aBuilder.SameParameter(edge,Standard_True); aBuilder.SameParameter(edge,Standard_True);
} }
} }