From a829053aed3ab1ef1cd1ad6c8105be1151dd49ab Mon Sep 17 00:00:00 2001 From: emv Date: Tue, 5 Dec 2017 14:22:22 +0300 Subject: [PATCH] 0029351: Boolean Operations create invalid pcurves When making pcurve for edge on face make sure that the produced 2D curve will have the same range as 3D curve of the edge. (cherry picked from commit 0a807dd9a320d93306dfea222ae5976a7a355549) --- src/BOPTools/BOPTools_AlgoTools2D.cxx | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/BOPTools/BOPTools_AlgoTools2D.cxx b/src/BOPTools/BOPTools_AlgoTools2D.cxx index 9697b92f56..2696de0e4e 100644 --- a/src/BOPTools/BOPTools_AlgoTools2D.cxx +++ b/src/BOPTools/BOPTools_AlgoTools2D.cxx @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -667,12 +668,25 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace } // TolReached2d=aTolR; - // + + // Adjust curve for periodic surface Handle(Geom2d_Curve) aC2DA; BOPTools_AlgoTools2D::AdjustPCurveOnSurf (*pBAS, aT1, aT2, aC2D, aC2DA); - // - aC2D=aC2DA; - // + aC2D = aC2DA; + + // Make sure that the range of the 2D curve is sufficient for representation of the 3D curve. + Standard_Real aTCFirst = aC2D->FirstParameter(); + Standard_Real aTCLast = aC2D->LastParameter(); + if ((aTCFirst - aT1) > Precision::PConfusion() || + (aT2 - aTCLast ) > Precision::PConfusion()) + { + if (aTCFirst < aT1) aTCFirst = aT1; + if (aTCLast > aT2) aTCLast = aT2; + + GeomLib::SameRange(Precision::PConfusion(), aC2D, + aTCFirst, aTCLast, aT1, aT2, aC2D); + } + // compute the appropriate tolerance for the edge Handle(Geom_Surface) aS = pBAS->Surface().Surface(); aS = Handle(Geom_Surface)::DownCast(aS->Transformed(pBAS->Trsf())); -- 2.39.5