Wrong bounding box for edge on periodic B-Spline with target
authorRoman Lygin <roman.lygin@gmail.com>
Sun, 20 May 2012 05:33:02 +0000 (09:33 +0400)
committerkgv <kgv@opencascade.com>
Fri, 15 Jun 2012 08:01:05 +0000 (12:01 +0400)
range beyond own range.
Improved consistency of 2D case with 3D

src/BndLib/BndLib_Add2dCurve.cxx
src/BndLib/BndLib_Add3dCurve.cxx

index 55b3a02..7c95adc 100755 (executable)
@@ -19,6 +19,7 @@
 
 #include <BndLib_Add2dCurve.ixx>
 #include <BndLib.hxx>
+#include <ElCLib.hxx>
 #include <GeomAbs_CurveType.hxx>
 
 #include <TColgp_Array1OfPnt2d.hxx>
@@ -121,15 +122,18 @@ void BndLib_Add2dCurve::Add( const Adaptor2d_Curve2d& C,
 
 
        Handle(Geom2d_Geometry) G = Bs->Copy();
-
        const Handle(Geom2d_BSplineCurve)& Bsaux = (*((Handle(Geom2d_BSplineCurve)*)&G));
-//  modified by NIZHNY-EAP Fri Dec  3 14:29:14 1999 ___BEGIN___
-       // To avoid exeption in Segment
        Standard_Real u1 = U1, u2 = U2;
-       if(Bsaux->FirstParameter() > U1) u1 = Bsaux->FirstParameter();
-       if(Bsaux->LastParameter()  < U2 ) u2  = Bsaux->LastParameter();
-//  modified by NIZHNY-EAP Fri Dec  3 14:29:18 1999 ___END___
-
+       if (Bsaux->IsPeriodic())
+         ElCLib::AdjustPeriodic( Bsaux->FirstParameter(), Bsaux->LastParameter(), Precision::PConfusion(), u1, u2 );
+       else {
+         ////////////////////////////////////////////////
+         //  modified by NIZHNY-EAP Fri Dec  3 14:29:14 1999 ___BEGIN___
+         // To avoid exeption in Segment
+         if(Bsaux->FirstParameter() > U1) u1 = Bsaux->FirstParameter();
+         if(Bsaux->LastParameter()  < U2 ) u2  = Bsaux->LastParameter();
+         //  modified by NIZHNY-EAP Fri Dec  3 14:29:18 1999 ___END___
+       }
        Bsaux->Segment(u1, u2);
        for (Standard_Integer i = 1; i <= Bsaux->NbPoles(); i++) {
          B.Add(Bsaux->Pole(i));
index 8bfd50e..acf686f 100755 (executable)
@@ -146,15 +146,14 @@ void BndLib_Add3dCurve::Add( const Adaptor3d_Curve& C,
        //// modified by jgv, 24.10.01 for BUC61031 ////
        if (Bsaux->IsPeriodic())
          ElCLib::AdjustPeriodic( Bsaux->FirstParameter(), Bsaux->LastParameter(), Precision::PConfusion(), u1, u2 );
-    else
-    {
+       else {
          ////////////////////////////////////////////////
          //  modified by NIZHNY-EAP Fri Dec  3 14:29:14 1999 ___BEGIN___
          // To avoid exeption in Segment
          if(Bsaux->FirstParameter() > U1) u1 = Bsaux->FirstParameter();
          if(Bsaux->LastParameter()  < U2 ) u2  = Bsaux->LastParameter();
          //  modified by NIZHNY-EAP Fri Dec  3 14:29:18 1999 ___END___
-    }
+       }
        Bsaux->Segment(u1, u2);
        Bs = Bsaux;
       }