]> OCCT Git - occt-copy.git/commitdiff
Geom2d_TrimmedCurve
authornbv <nbv@opencascade.com>
Wed, 25 Oct 2017 13:51:39 +0000 (16:51 +0300)
committernbv <nbv@opencascade.com>
Mon, 10 Dec 2018 15:11:18 +0000 (18:11 +0300)
64 files changed:
src/Adaptor3d/Adaptor3d_CurveOnSurface.cxx
src/BRepBuilderAPI/BRepBuilderAPI_Sewing.cxx
src/BRepClass/BRepClass_Intersector.cxx
src/BRepFill/BRepFill_OffsetWire.cxx
src/BRepLib/BRepLib.cxx
src/BRepLib/BRepLib_MakeEdge.cxx
src/BRepLib/BRepLib_MakeEdge2d.cxx
src/BRepOffset/BRepOffset_Inter2d.cxx
src/BRepTools/BRepTools.cxx
src/BRepTools/BRepTools.hxx
src/BRepTools/BRepTools_NurbsConvertModification.cxx
src/BRepTools/BRepTools_TrsfModification.cxx
src/BinTools/BinTools_Curve2dSet.cxx
src/Bisector/Bisector_BisecAna.cxx
src/Bisector/Bisector_BisecAna.hxx
src/Bisector/Bisector_BisecCC.cxx
src/Bisector/Bisector_BisecCC.hxx
src/Bisector/Bisector_BisecPC.cxx
src/Bisector/Bisector_BisecPC.hxx
src/ChFi2d/ChFi2d_FilletAlgo.cxx
src/ChFi3d/ChFi3d_Builder_0.cxx
src/ChFi3d/ChFi3d_Builder_C1.cxx
src/DBRep/DBRep_IsoBuilder.cxx
src/DrawTrSurf/DrawTrSurf_BSplineCurve2d.cxx
src/Geom2d/Geom2d_BSplineCurve.cxx
src/Geom2d/Geom2d_BSplineCurve.hxx
src/Geom2d/Geom2d_BSplineCurve_1.cxx
src/Geom2d/Geom2d_BezierCurve.cxx
src/Geom2d/Geom2d_BezierCurve.hxx
src/Geom2d/Geom2d_Circle.cxx
src/Geom2d/Geom2d_Circle.hxx
src/Geom2d/Geom2d_Curve.cxx
src/Geom2d/Geom2d_Curve.hxx
src/Geom2d/Geom2d_Ellipse.cxx
src/Geom2d/Geom2d_Ellipse.hxx
src/Geom2d/Geom2d_Hyperbola.cxx
src/Geom2d/Geom2d_Hyperbola.hxx
src/Geom2d/Geom2d_Line.cxx
src/Geom2d/Geom2d_Line.hxx
src/Geom2d/Geom2d_OffsetCurve.cxx
src/Geom2d/Geom2d_OffsetCurve.hxx
src/Geom2d/Geom2d_Parabola.cxx
src/Geom2d/Geom2d_Parabola.hxx
src/Geom2d/Geom2d_TrimmedCurve.cxx
src/Geom2d/Geom2d_TrimmedCurve.hxx
src/Geom2dAdaptor/Geom2dAdaptor_Curve.cxx
src/Geom2dConvert/Geom2dConvert.cxx
src/Geom2dConvert/Geom2dConvert_BSplineCurveToBezierCurve.cxx
src/GeomLib/GeomLib.cxx
src/GeomLib/GeomLib.hxx
src/GeomLib/GeomLib_Check2dBSplineCurve.cxx
src/GeomProjLib/GeomProjLib.cxx
src/GeomToStep/GeomToStep_MakeBoundedCurve.cxx
src/GeomTools/GeomTools_Curve2dSet.cxx
src/Hermit/Hermit.cxx
src/IGESToBRep/IGESToBRep_IGESBoundary.cxx
src/IntTools/IntTools_FaceFace.cxx
src/MAT2d/MAT2d_Tool2d.cxx
src/ShapeAnalysis/ShapeAnalysis_Curve.cxx
src/ShapeBuild/ShapeBuild_Edge.cxx
src/ShapeConstruct/ShapeConstruct.cxx
src/ShapeFix/ShapeFix_ComposeShell.cxx
src/ShapePersistent/ShapePersistent_Geom2d_Curve.cxx
src/ShapeUpgrade/ShapeUpgrade.cxx

index ebf7fa580c88a782a7eee18e4a4848d058dcd008..b2dd23a2c5e1394a2fc96539714397225e82ae43 100644 (file)
@@ -1375,12 +1375,12 @@ Handle(Geom_BSplineCurve) Adaptor3d_CurveOnSurface::BSpline() const
     Bsp2d->Weights(Weights);
     Bsp = new Geom_BSplineCurve(Poles,Weights,Knots,Mults,
                                Bsp2d->Degree(),
-                               Bsp2d->IsPeriodic());
+                               Bsp2d->IsPeriodic111());
   }
   else {
     Bsp = new Geom_BSplineCurve(Poles,Knots,Mults,
                                Bsp2d->Degree(),
-                               Bsp2d->IsPeriodic());
+                               Bsp2d->IsPeriodic111());
   }
   return Bsp;
 }
index 7d3db72134af3ed04f27d0ffda85eab817634b9b..4fe7976c4bdc7593ec1f2749d1c7f5778db2267e 100644 (file)
@@ -217,9 +217,9 @@ static Standard_Boolean IsClosedByIsos(const Handle(Geom_Surface)& thesurf,
 {
   Standard_Boolean isClosed = Standard_False;
  
-  gp_Pnt2d psurf1 = (acrv2d->IsPeriodic() ? 
+  gp_Pnt2d psurf1 = (acrv2d->IsPeriodic111() ? 
                      acrv2d->Value(f2d) :  acrv2d->Value(Max(f2d,acrv2d->FirstParameter())));
-  gp_Pnt2d psurf2 = (acrv2d->IsPeriodic() ? 
+  gp_Pnt2d psurf2 = (acrv2d->IsPeriodic111() ? 
                      acrv2d->Value(l2d) :  acrv2d->Value(Min(l2d,acrv2d->LastParameter())));
   Handle(Geom_Curve) aCrv1;
   Handle(Geom_Curve) aCrv2;
index 847d877329ca4c75fe377ce99b5a53f83df4f270..a47bb03a6122d51c92751158f8098f53932df51a 100644 (file)
@@ -142,13 +142,6 @@ void  BRepClass_Intersector::Perform(const gp_Lin2d& L,
   }
 
   IntRes2d_Domain DE(pdeb,deb,toldeb,pfin,fin,tolfin);
-  // temporary periodic domain
-  if (C.Curve()->IsPeriodic()) {
-    DE.SetEquivalentParameters(C.FirstParameter(),
-      C.FirstParameter() + 
-      C.Curve()->LastParameter() -
-      C.Curve()->FirstParameter());
-  }
 
   Handle(Geom2d_Line) GL= new Geom2d_Line(L);
   Geom2dAdaptor_Curve CGA(GL);
index 876501e15eec4e9ef2d87c98a1d65ca1b896146c..dcb8715612b798465b0e974906373d725cb696b7 100644 (file)
 #include <TopTools_MapIteratorOfMapOfShape.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <TopTools_SequenceOfShape.hxx>
+#include <GeomLib.hxx>
 
 #include <stdio.h>
 #ifdef OCCT_DEBUG
@@ -1292,14 +1293,8 @@ void BRepFill_OffsetWire::UpdateDetromp (BRepFill_DataMapOfOrientedShapeListOfSh
     TopoDS_Vertex    V1,V2;
     
     const Handle(Geom2d_Curve)& Bis = Bisec.Value();
-    Standard_Boolean ForceAdd = Standard_False;
-    Handle(Geom2d_TrimmedCurve) aTC = Handle(Geom2d_TrimmedCurve)::DownCast(Bis);
-    if(!aTC.IsNull() && aTC->BasisCurve()->IsPeriodic())
-    {
-      gp_Pnt2d Pf = Bis->Value(Bis->FirstParameter());
-      gp_Pnt2d Pl = Bis->Value(Bis->LastParameter());
-      ForceAdd = Pf.Distance(Pl) <= Precision::Confusion();
-    }
+    const Standard_Boolean ForceAdd = (Bis->IsPeriodic111() &&
+                                       GeomLib::IsClosed(Bis, Precision::Confusion()));
 
     U1 = Bis->FirstParameter();
     
index f6006c5d3889c4a30f0851218d7087dbf9a89bcf..defe660fba2b24da0ed568653186618da468b835 100644 (file)
@@ -1384,7 +1384,7 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge,
             Geom2dConvert::C0BSplineToC1BSplineCurve(bs2d, Tol2d);
             isBSP = Standard_True; 
 
-            if(bs2d->IsPeriodic()) { // -------- IFV, Jan 2000
+            if(bs2d->IsPeriodic111()) { // -------- IFV, Jan 2000
               gp_Pnt2d NewOriginPoint;
               bs2d->D0(bs2d->FirstParameter(), NewOriginPoint);
               if(Abs(OriginPoint.X() - NewOriginPoint.X()) > Precision::PConfusion() ||
@@ -1429,7 +1429,7 @@ TopoDS_Edge BRepLib::SameParameter(const TopoDS_Edge& theEdge,
 
                 Geom2dConvert::C0BSplineToC1BSplineCurve(bs2d,Tol2dbail);
 
-                if(bs2d->IsPeriodic()) { // -------- IFV, Jan 2000
+                if(bs2d->IsPeriodic111()) { // -------- IFV, Jan 2000
                   gp_Pnt2d NewOriginPoint;
                   bs2d->D0(bs2d->FirstParameter(), NewOriginPoint);
                   if(Abs(OriginPoint.X() - NewOriginPoint.X()) > Precision::PConfusion() ||
index 6a3d8d52d6294f015849545ef489fc50e25da57a..c733c24b3146f914501f7dbd86ea55083786674a 100644 (file)
@@ -1059,7 +1059,7 @@ void  BRepLib_MakeEdge::Init(const Handle(Geom2d_Curve)& CC,
   Standard_Real cf = C->FirstParameter();
   Standard_Real cl = C->LastParameter();
   Standard_Real epsilon = Precision::PConfusion();
-  Standard_Boolean periodic = C->IsPeriodic();
+  Standard_Boolean periodic = C->IsPeriodic111();
 
 
   TopoDS_Vertex V1,V2;
index f04af3e5a8d3b8a966662c6f02b0c110c268c32a..7a143f152633cb9a73efd4e7c7cee6bcd740518f 100644 (file)
@@ -594,7 +594,7 @@ void  BRepLib_MakeEdge2d::Init(const Handle(Geom2d_Curve)& CC,
   Standard_Real cf = C->FirstParameter();
   Standard_Real cl = C->LastParameter();
   Standard_Real epsilon = Precision::Confusion();
-  Standard_Boolean periodic = C->IsPeriodic();
+  Standard_Boolean periodic = C->IsPeriodic111();
 
 
   TopoDS_Vertex V1,V2;
index 8d4d0c83c3c727456ed541ed64612bccdb3367d1..7f933e4533ad41c4766320fc12e9d0a21d3f35c3 100644 (file)
@@ -951,6 +951,9 @@ void BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const
           if (theCurve->IsKind(STANDARD_TYPE(Geom2d_BoundedCurve)) &&
               (FirstPar > anEf - a2Offset || LastPar < anEl + a2Offset))
             {
+              // Trimmed curves or periodic B-spline curves are processed
+              // in this branch.
+
               Handle(Geom2d_Curve) NewPCurve;
               if (ExtendPCurve(theCurve, anEf, anEl, a2Offset, NewPCurve))
                 {
@@ -965,7 +968,7 @@ void BRepOffset_Inter2d::ExtentEdge(const TopoDS_Edge& E,TopoDS_Edge& NE, const
                     }
                 }
             }
-          else if (theCurve->IsPeriodic())
+          else if (theCurve->IsPeriodic111())
             {
               Standard_Real delta = (theCurve->Period() - (anEl - anEf))*0.5;
               delta *= 0.95;
index 7572bdc0e82e95562413bd032f3c670f9f1adb1c..291b4161cbbb413f79a1ba4acbfa2e0f66c48c40 100644 (file)
@@ -1025,7 +1025,7 @@ Standard_Real BRepTools::EvalAndUpdateTol(const TopoDS_Edge& theE,
     first = Max(first, C3d->FirstParameter());
     last = Min(last, C3d->LastParameter());
   }
-  if(!C2d->IsPeriodic())
+  if(!C2d->IsPeriodic111())
   {
     first = Max(first, C2d->FirstParameter());
     last = Min(last, C2d->LastParameter());
@@ -1040,7 +1040,7 @@ Standard_Real BRepTools::EvalAndUpdateTol(const TopoDS_Edge& theE,
   else
   {
     if(CT.ErrorStatus() == 3 || (CT.ErrorStatus() == 2 &&
-      (C3d->IsPeriodic() || C2d->IsPeriodic())))
+      (C3d->IsPeriodic() || C2d->IsPeriodic111())))
     {
       //Try to estimate by sample points
       Standard_Integer nbint = 22;
index e6bc4b5db67dde4cd1d4addb1e058a8eabfc1485..36b9d0a048065a15c4c256d953dc067189673b1c 100644 (file)
@@ -212,7 +212,7 @@ public:
 
   //! Evals real tolerance of edge  <theE>.
   //! <theC3d>, <theC2d>, <theS>, <theF>, <theL> are
-  //! correspondently 3d curve of edge, 2d curve on surface <theS> and
+  //! correspondingly 3d curve of edge, 2d curve on surface <theS> and
   //! rang of edge
   //! If calculated tolerance is more then current edge tolerance, edge is updated.
   //! Method returns actual tolerance of edge
index 1a8de56f7eef9eb96abe02d947e59b54bed32b4a..ff537180be311fbffa3a94d958b9229b0e179dd0 100644 (file)
@@ -388,7 +388,7 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewCurve2d
 
     Standard_Real fc = C2d->FirstParameter(), lc = C2d->LastParameter();
 
-    if(!C2d->IsPeriodic()) {
+    if(!C2d->IsPeriodic111()) {
       if(fc - f2d > Precision::PConfusion()) f2d = fc;
       if(l2d - lc > Precision::PConfusion()) l2d = lc;
     }
index 6bc92499cd7d64ca2dae82aedb7ba34f69c2daf8..1afca5c80ba2aa3bc60ea7a88ab590fa8fcda55e 100644 (file)
@@ -177,7 +177,7 @@ Standard_Boolean BRepTools_TrsfModification::NewCurve2d
 
   Standard_Real fc = NewC->FirstParameter(), lc = NewC->LastParameter();
 
-  if(!NewC->IsPeriodic()) {
+  if(!NewC->IsPeriodic111()) {
     if(fc - f > Precision::PConfusion()) f = fc;
     if(l - lc > Precision::PConfusion()) l = lc;
     if(Abs(l - f) < Precision::PConfusion())
index 0f34bf736cd508cc89b85dda9f2cf63390699da3..c93de1cf2fafb546f41f87a27d6c1130698bd7b4 100644 (file)
@@ -239,7 +239,7 @@ static Standard_OStream& operator <<(Standard_OStream& OS, const Handle(Geom2d_B
   OS << (Standard_Byte)BSPLINE;
   Standard_Boolean aRational = B->IsRational() ? 1:0;
   BinTools::PutBool(OS, aRational); //rational
-  Standard_Boolean aPeriodic = B->IsPeriodic() ? 1:0;
+  Standard_Boolean aPeriodic = B->IsPeriodic111() ? 1:0;
   BinTools::PutBool(OS, aPeriodic); //periodic
   // poles and weights
   Standard_Integer i,aDegree,aNbPoles,aNbKnots;
index 6e5330d7ec737e88f24ef6fe63d7f816cf07734f..dd8c6e644d0c3bed07385f24674ef3637a1aca03 100644 (file)
@@ -1396,9 +1396,9 @@ Standard_Boolean Bisector_BisecAna::IsClosed() const
 //function : IsPeriodic
 //purpose  :
 //=============================================================================
-Standard_Boolean Bisector_BisecAna::IsPeriodic() const 
+Standard_Boolean Bisector_BisecAna::IsPeriodic111() const 
 {
-  return thebisector->BasisCurve()->IsPeriodic(); 
+  return thebisector->IsPeriodic111();
 }
 
 //=============================================================================
index fbc0b8a21d94824097d851c14e0a8c385cc3f196..a63bafd7eac974d18f890cec0763eb98b0ff193a 100644 (file)
@@ -104,7 +104,7 @@ public:
   
   Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
   
-  Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
   
   Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
   
index 3689f9e92efa98f5affea800977b67ecbc9fb73d..6bbcd13c1e20c0985f1b7154db97601afac242ef 100644 (file)
@@ -540,7 +540,7 @@ Standard_Boolean Bisector_BisecCC::IsClosed() const
 //function : IsPeriodic
 //purpose  :
 //=============================================================================
-Standard_Boolean Bisector_BisecCC::IsPeriodic() const
+Standard_Boolean Bisector_BisecCC::IsPeriodic111() const
 {
   return Standard_False;
 }
index 8340c0f76c11b58c0aedbebf6a8f4c65db0f7cbc..b66bd539310222ea428b809da8e6a692bb78385f 100644 (file)
@@ -127,7 +127,7 @@ public:
   
   Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
   
-  Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
   
   //! Returns the point of parameter U.
   //! Computes the distance between the current point and
index ad03ff2cefe4d7240dd5655ecfa2666a656d7cef..915fbb224ed678a8f9afda5fcd4a96d95418e3ee 100644 (file)
@@ -313,7 +313,7 @@ Standard_Boolean Bisector_BisecPC::IsClosed() const
 //function : IsPeriodic
 //purpose  :
 //=============================================================================
-Standard_Boolean Bisector_BisecPC::IsPeriodic() const
+Standard_Boolean Bisector_BisecPC::IsPeriodic111() const
 {
   return Standard_False;
 }
@@ -703,11 +703,11 @@ void Bisector_BisecPC::ComputeIntervals ()
   //------------------------------------------------------------------------
   // Eventual offset of the parameter on the curve correspondingly to the one 
   // on the curve. The offset can be done if the curve is periodical and the 
-  // point of initial parameter is less then the interval of continuity.
+  // point of initial parameter is less than the interval of continuity.
   //------------------------------------------------------------------------
-  if (curve->IsPeriodic()) {
+  if (curve->IsPeriodic111()) {
     if (startIntervals.Length() > 1) {               // Plusieurs intervals.
-      if (endIntervals  .Last()  == curve->LastParameter() &&
+      if (endIntervals.Last()  == curve->LastParameter() &&
          startIntervals.First() == curve->FirstParameter()   ) {
        //---------------------------------------------------------------
        // the bissectrice is defined at the origin.
@@ -716,7 +716,7 @@ void Bisector_BisecPC::ComputeIntervals ()
        // => offset of parameter on all limits of intervals.
        //---------------------------------------------------------------
        startIntervals.Remove(1);
-       endIntervals  .Remove(endIntervals.Length());
+       endIntervals.Remove(endIntervals.Length());
        
        shiftParameter = Period() - startIntervals.First() ;
        for (Standard_Integer k = 1; k <= startIntervals.Length(); k++) {
index a748e7e4f5f36ccbef22ceea7cc8d35d1ecd825e..096cba19266150360c5c911065942cea5019aa1e 100644 (file)
@@ -132,7 +132,7 @@ public:
   
   Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
   
-  Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
   
   //! Returns   the   distance   between  the  point  of
   //! parameter U on <me> and my point or my curve.
index 0eff8be730e4a88816c97b12da50666e02a2b3c5..b4524533a809afec308a3d87c2c43fbc3ca07a37 100644 (file)
@@ -116,16 +116,22 @@ void ChFi2d_FilletAlgo::Init(const TopoDS_Edge& theEdge1,
     myEdge2 = theEdge2;
   }
 
+  // Trimmed curve cannot be returned
   Handle(Geom_Curve) aCurve1 = BRep_Tool::Curve(myEdge1, myStart1, myEnd1);
   Handle(Geom_Curve) aCurve2 = BRep_Tool::Curve(myEdge2, myStart2, myEnd2);
 
   myCurve1 = GeomProjLib::Curve2d(aCurve1, myStart1, myEnd1, myPlane);
   myCurve2 = GeomProjLib::Curve2d(aCurve2, myStart2, myEnd2, myPlane);
 
-  while (myCurve1->IsPeriodic() && myStart1 >= myEnd1)
-    myEnd1 += myCurve1->Period();
-  while (myCurve2->IsPeriodic() && myStart2 >= myEnd2)
-    myEnd2 += myCurve2->Period();
+  if(myCurve1->IsPeriodic111() && myStart1 >= myEnd1)
+  {
+    myEnd1 = ElCLib::InPeriod(myEnd1, myStart1, myStart1 + myCurve1->Period());
+  }
+
+  if(myCurve2->IsPeriodic111() && myStart2 >= myEnd2)
+  {
+    myEnd2 = ElCLib::InPeriod(myEnd2, myStart2, myStart2 + myCurve2->Period());
+  }
  
   if (aBAC1.GetType() == aBAC2.GetType()) 
   {
@@ -267,8 +273,10 @@ void ChFi2d_FilletAlgo::FillPoint(FilletPoint* thePoint, const Standard_Real the
 
     // checking the right parameter
     Standard_Real aParamProj = aProj.Parameter(a);
-    while(myCurve2->IsPeriodic() && aParamProj < myStart2)
-      aParamProj += myCurve2->Period();
+    if(myCurve2->IsPeriodic111() && aParamProj < myStart2)
+    {
+      aParamProj = ElCLib::InPeriod(aParamProj, myStart2, myStart2 + myCurve2->Period());
+    }
 
     const Standard_Real d = aProj.Distance(a);
     thePoint->appendValue(d * d - myRadius * myRadius, (aParamProj >= myStart2 && aParamProj <= myEnd2 && aValid2));
index 1d92766f8e50922cc4251483216224976a5e0beb..aed6ab954359629298fc8a3befa8814123435667 100644 (file)
@@ -983,13 +983,19 @@ Standard_Boolean ChFi3d_IntTraces(const Handle(ChFiDS_SurfData)& fd1,
   if(enlarge) delta = Min(0.1,0.05*(last-first));
   Handle(Geom2d_Curve) pcf1 = fd1->Interference(jf1).PCurveOnFace();
   if(pcf1.IsNull()) return Standard_False;
-  Standard_Boolean isper1 = pcf1->IsPeriodic();
-  if(isper1) {
+  Standard_Boolean isper1 = pcf1->IsPeriodic111();
+  if(isper1)
+  {
+    // Extract basis curve to obtain its First and Last parameters.
     Handle(Geom2d_TrimmedCurve) tr1 = Handle(Geom2d_TrimmedCurve)::DownCast(pcf1);
     if(!tr1.IsNull()) pcf1 = tr1->BasisCurve();
     C1.Load(pcf1);
   }
-  else C1.Load(pcf1,first-delta,last+delta);
+  else
+  {
+    C1.Load(pcf1, first - delta, last + delta);
+  }
+
   Standard_Real first1 = pcf1->FirstParameter(), last1 = pcf1->LastParameter();
 
   first = fd2->Interference(jf2).FirstParameter();
@@ -999,13 +1005,19 @@ Standard_Boolean ChFi3d_IntTraces(const Handle(ChFiDS_SurfData)& fd1,
   if(enlarge) delta = Min(0.1,0.05*(last-first));
   Handle(Geom2d_Curve) pcf2 = fd2->Interference(jf2).PCurveOnFace();
   if(pcf2.IsNull()) return Standard_False;
-  Standard_Boolean isper2 = pcf2->IsPeriodic();
-  if(isper2) {
+  Standard_Boolean isper2 = pcf2->IsPeriodic111();
+  if(isper2)
+  {
+    // Extract basis curve to obtain its First and Last parameters.
     Handle(Geom2d_TrimmedCurve) tr2 = Handle(Geom2d_TrimmedCurve)::DownCast(pcf2);
     if(!tr2.IsNull()) pcf2 = tr2->BasisCurve();
     C2.Load(pcf2);
   }
-  else C2.Load(fd2->Interference(jf2).PCurveOnFace(),first-delta,last+delta);
+  else
+  {
+    C2.Load(pcf2, first - delta, last + delta);
+  }
+
   Standard_Real first2 = pcf2->FirstParameter(), last2 = pcf2->LastParameter();
 
   IntRes2d_IntersectionPoint int2d;
index b63ad083373d260fbcbdfe3a63c656497b00bd78..621d34ed30be880644947afebb4d39228422856c 100644 (file)
@@ -384,9 +384,10 @@ static Standard_Boolean Update(const Handle(Adaptor3d_HSurface)& face,
       if (!PConF.IsNull())
       {
         Handle(Geom2d_TrimmedCurve) aTrCurve = Handle(Geom2d_TrimmedCurve)::DownCast(PConF);
+        // Extract basis curve to obtain its first/last parameters.
         if (!aTrCurve.IsNull())
           PConF = aTrCurve->BasisCurve();
-        if (!PConF->IsPeriodic())
+        if (!PConF->IsPeriodic111())
         {
           if (isfirst)
           {
index f02475cfcb6c586f854073a0a5eb917b4e14856a..465483486db7b8b1ef3c10a77cc13de2eee05a80 100644 (file)
@@ -138,7 +138,7 @@ Geom2dHatch_Hatcher (Geom2dHatch_Intersector (IntersectorConfusion,
     }
     else
     {
-      if (!PCurve->IsPeriodic())
+      if (!PCurve->IsPeriodic111())
       {
         Handle (Geom2d_TrimmedCurve) TrimPCurve = Handle(Geom2d_TrimmedCurve)::DownCast (PCurve);
         if (!TrimPCurve.IsNull())
index 814e3ebf9fc60334f1fa3097fbaffd53cba3eb94..7814e3300febfa3a9c3d91fc142dd3fdbfdc3b4c 100644 (file)
@@ -71,7 +71,7 @@ void DrawTrSurf_BSplineCurve2d::DrawOn (Draw_Display& dis) const
     for (Standard_Integer i = 2; i <= NbPoles; i++) {
       dis.DrawTo(CPoles(i));
     }
-    if (C->IsPeriodic())
+    if (C->IsPeriodic111() && C->IsClosed())
       dis.DrawTo(CPoles(1));
   }
 
index b4cc7df96e076d6065c07a7ad87d1dc64d4254b9..749049dd69264125a6a29f2d834c84ec98bd96b0 100644 (file)
@@ -1185,7 +1185,7 @@ MovePointAndTangent(const Standard_Real    U,
                    Standard_Integer&      ErrorStatus) 
 {
   Standard_Integer ii ;
-  if (IsPeriodic()) {
+  if (IsPeriodic111()) {
     //
     // for the time being do not deal with periodic curves
     //
index 948a01f849f0d8cdec03136cb06fae22b94ce546..4823c9651dfd2995208dd1831f333e288d94dd74 100644 (file)
@@ -537,7 +537,7 @@ public:
   Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
   
   //! Returns True if the curve is periodic.
-  Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
   
 
   //! Returns True if the weights are not identical.
index a4142a5b2f4940169788fcbdf466f6c4498dc952..1f5f5a931065966a2d864c352f71087e400803ca 100644 (file)
@@ -113,7 +113,7 @@ Standard_Boolean Geom2d_BSplineCurve::IsG1 ( const Standard_Real theTf,
       return Standard_False;
   }
 
-  if(!IsPeriodic())
+  if(!IsPeriodic111())
     return Standard_True;
 
   const Standard_Real aFirstParam = FirstParameter(),
@@ -164,7 +164,7 @@ Standard_Boolean Geom2d_BSplineCurve::IsClosed () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom2d_BSplineCurve::IsPeriodic () const
+Standard_Boolean Geom2d_BSplineCurve::IsPeriodic111 () const
 { return periodic; }
 
 //=======================================================================
index 38250afe4474a81109e12bdfe6de7d448aa90475..3db8594c7b0546d791b48ebbb5f4338aa617162a 100644 (file)
@@ -493,7 +493,7 @@ Standard_Boolean Geom2d_BezierCurve::IsCN (const Standard_Integer ) const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom2d_BezierCurve::IsPeriodic () const 
+Standard_Boolean Geom2d_BezierCurve::IsPeriodic111 () const 
 {
   return Standard_False; 
 }
index 0d61dc4b45881f9daca8e9559b8348dd6f94da3f..b790d4e6d3ffce4136525be1c7ca6726512c9f61 100644 (file)
@@ -216,7 +216,7 @@ public:
 
   //! Returns False. A BezierCurve cannot be periodic in this
   //! package
-  Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
   
 
   //! Returns false if all the weights are identical. The tolerance
index 3bac3eb3ec9ebb43b8f7ade51a90993af71c8bf8..6ad9a54f90fb96f6ba5d9276232f8441c0c360a1 100644 (file)
@@ -187,7 +187,7 @@ Standard_Boolean Geom2d_Circle::IsClosed () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom2d_Circle::IsPeriodic () const      
+Standard_Boolean Geom2d_Circle::IsPeriodic111 () const      
 {
   return Standard_True; 
 }
index 76e55766e4d752a0deb44407dc782840e4c89195..c93a39413f00ddfbc432fde407fa054fb0bdaaba 100644 (file)
@@ -122,7 +122,7 @@ public:
   Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
   
   //! returns True. The period of a circle is 2.*Pi.
-  Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
   
   //! Returns in P the point of parameter U.
   //! P = C + R * Cos (U) * XDir + R * Sin (U) * YDir
index 59ed0848ebcca04d753791d018c3457b9c2221ea..834278327a49abd8b01ffe5cb347ae5b0199ba09 100644 (file)
@@ -71,7 +71,7 @@ Standard_Real Geom2d_Curve::ParametricTransformation(const gp_Trsf2d& ) const
 Standard_Real Geom2d_Curve::Period() const
 {
   Standard_NoSuchObject_Raise_if
-    ( !IsPeriodic(),"Geom2d_Curve::Period");
+    ( !IsPeriodic111(),"Geom2d_Curve::Period");
 
   return ( LastParameter() - FirstParameter());
 }
index 844993b2bbfba594441fd6ea1daf112810d0a2c9..62e9d7eacb9e79400462eee715195da6d24348c4 100644 (file)
@@ -151,7 +151,7 @@ public:
   //! periodic or not the default periodicity set is non periodic
   //! and you have to turn (explicitly) the curve into a periodic
   //! curve  if you want the curve to be periodic.
-  Standard_EXPORT virtual Standard_Boolean IsPeriodic() const = 0;
+  Standard_EXPORT virtual Standard_Boolean IsPeriodic111() const = 0;
   
   //! Returns thne period of this curve.
   //! raises if the curve is not periodic
index e9dbbbc6fb12c68eaeee290ae8e0d093b1005920..22f6e7233eabb9db01ddf979e38c7c7664eeac31 100644 (file)
@@ -309,7 +309,7 @@ Standard_Boolean Geom2d_Ellipse::IsClosed () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom2d_Ellipse::IsPeriodic () const     
+Standard_Boolean Geom2d_Ellipse::IsPeriodic111 () const     
 {
   return Standard_True; 
 }
index 78ff674e61d353aaf8d4776f414a15f0cb8be3f2..1a84c5da735f7ea118dacd8cf6371b00e6c55917 100644 (file)
@@ -210,7 +210,7 @@ public:
   Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
   
   //! return True.
-  Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
   
   //! Returns in P the point of parameter U.
   //! P = C + MajorRadius * Cos (U) * XDir + MinorRadius * Sin (U) * YDir
index ef357a88c108d746b3fcf82b888f521cd410117a..a53844b59713aa1c1913bd300792c94965f80a80 100644 (file)
@@ -199,7 +199,7 @@ Standard_Boolean Geom2d_Hyperbola::IsClosed () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom2d_Hyperbola::IsPeriodic () const    
+Standard_Boolean Geom2d_Hyperbola::IsPeriodic111 () const    
 {
   return Standard_False; 
 }
index 02e341d9a78f77f44544400c4dcc654676589c8d..14b319945e0c9ee5d549f8558c16ae2d3667026a 100644 (file)
@@ -149,7 +149,7 @@ public:
   Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
   
   //! return False for an hyperbola.
-  Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
   
 
   //! In the local coordinate system of the hyperbola the
index 6ac9b7b77438527c0df4bc1c72827eeec894b067..3efbc1aaf088260ab55a54456aa74415abc42648 100644 (file)
@@ -171,7 +171,7 @@ Standard_Boolean Geom2d_Line::IsClosed () const          { return Standard_False
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom2d_Line::IsPeriodic () const        { return Standard_False;  }
+Standard_Boolean Geom2d_Line::IsPeriodic111 () const        { return Standard_False;  }
 
 //=======================================================================
 //function : Continuity
index ed74a2052286efedfe0c0699961291b3cb6666be..f74300d8d9c2d7f431ec057a5cab4ca87fc91d8c 100644 (file)
@@ -123,7 +123,7 @@ public:
   Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
   
   //! Returns False
-  Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
   
   //! Returns GeomAbs_CN, which is the global continuity of any line.
   Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE;
index 2c4ea9536c2695af6bd1844995c79979f73f4e25..a09e0511ac9f53784589bed3cc193d9461c1b272 100644 (file)
@@ -330,9 +330,9 @@ Standard_Boolean Geom2d_OffsetCurve::IsCN (const Standard_Integer N) const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom2d_OffsetCurve::IsPeriodic () const 
+Standard_Boolean Geom2d_OffsetCurve::IsPeriodic111 () const 
 { 
-  return basisCurve->IsPeriodic();
+  return basisCurve->IsPeriodic111();
 }
 
 //=======================================================================
index 0886f46baafc6d5528167963780bb6d66dab99ad..4e3de5b31740c6244930cc5dda652b84c7442c84 100644 (file)
@@ -242,7 +242,7 @@ public:
   //! If the basis curve is a circle or an ellipse the corresponding
   //! OffsetCurve is periodic. If the basis curve can't be periodic
   //! (for example BezierCurve) the OffsetCurve can't be periodic.
-  Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
   
   //! Returns the period of this offset curve, i.e. the period
   //! of the basis curve of this offset curve.
index f7bfd21d64faea7323be25b75c18162d67479947..dfae16c49ada56c3cd1a728cfc017ebcaeff4ab9 100644 (file)
@@ -185,7 +185,7 @@ Standard_Boolean Geom2d_Parabola::IsClosed ()   const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom2d_Parabola::IsPeriodic () const    
+Standard_Boolean Geom2d_Parabola::IsPeriodic111 () const    
 {
   return Standard_False; 
 }
index fa5f2a76c6eee920006b2f87f404099328bd3c6e..895403390d49e9480833dee21050aad54eefe09f 100644 (file)
@@ -128,7 +128,7 @@ public:
   Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
   
   //! Returns False
-  Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
   
   //! The directrix is parallel to the "YAxis" of the parabola.
   //! The "Location" point of the directrix is the intersection
index 9cbfa698585994e817a80ec1a98b22a6885bde3b..330c1f7ccf7df98fdb18203b5c2103293ff6948e 100644 (file)
@@ -123,7 +123,7 @@ void Geom2d_TrimmedCurve::SetTrim (const Standard_Real U1,
   Standard_Real Udeb = basisCurve->FirstParameter();
   Standard_Real Ufin = basisCurve->LastParameter();
   
-  if (basisCurve->IsPeriodic())  {
+  if (IsPeriodic111())  {
      sameSense = Sense;
       
      // set uTrim1 in the range Udeb , Ufin
@@ -209,12 +209,10 @@ Standard_Real Geom2d_TrimmedCurve::FirstParameter () const       { return uTrim1
 //function : IsClosed
 //purpose  : 
 //=======================================================================
-
-Standard_Boolean Geom2d_TrimmedCurve::IsClosed () const          
+Standard_Boolean Geom2d_TrimmedCurve::IsClosed() const
 {
-  Standard_Real Dist = 
-    Value(FirstParameter()).Distance(Value(LastParameter()));
-  return ( Dist <= gp::Resolution());
+  return
+    (Value(FirstParameter()).SquareDistance(Value(LastParameter())) < gp::Resolution());
 }
 
 //=======================================================================
@@ -222,10 +220,9 @@ Standard_Boolean Geom2d_TrimmedCurve::IsClosed () const
 //purpose  : 
 //=======================================================================
 
-Standard_Boolean Geom2d_TrimmedCurve::IsPeriodic () const        
+Standard_Boolean Geom2d_TrimmedCurve::IsPeriodic111() const
 {
-  //return basisCurve->IsPeriodic();
-  return Standard_False;
+  return basisCurve->IsPeriodic111();
 }
 
 //=======================================================================
index 57e905fb25f72cbd93efa943c914461dac85de18..4f0b7ea3cf11172e1ee072daf04113c061a681dd 100644 (file)
@@ -173,7 +173,7 @@ public:
   Standard_EXPORT Standard_Boolean IsClosed() const Standard_OVERRIDE;
   
   //! Always returns FALSE (independently of the type of basis curve).
-  Standard_EXPORT Standard_Boolean IsPeriodic() const Standard_OVERRIDE;
+  Standard_EXPORT Standard_Boolean IsPeriodic111() const Standard_OVERRIDE;
   
   //! Returns the period of the basis curve of this trimmed curve.
   //! Exceptions
index 63bb4420f1cd8f7c47379f94c24f06223e9a4664..e34f5a3e9416fb289e69ad0b2a5693c282b165e4 100644 (file)
@@ -86,9 +86,9 @@ GeomAbs_Shape Geom2dAdaptor_Curve::LocalContinuity(const Standard_Real U1,
        TColStd_Array1OfInteger TM(1,Nb);
        myBSplineCurve->Knots(TK);
        myBSplineCurve->Multiplicities(TM);
-       BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,U1,myBSplineCurve->IsPeriodic(),
+       BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,U1,myBSplineCurve->IsPeriodic111(),
                                 1,Nb,Index1,newFirst);
-       BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,U2,myBSplineCurve->IsPeriodic(),
+       BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,U2,myBSplineCurve->IsPeriodic111(),
                                 1,Nb,Index2,newLast);
        if ( Abs(newFirst-TK(Index1+1))<Precision::PConfusion()) { 
         if (Index1 < Nb)Index1++;
@@ -97,7 +97,7 @@ GeomAbs_Shape Geom2dAdaptor_Curve::LocalContinuity(const Standard_Real U1,
         Index2--;
        Standard_Integer MultMax;
        // attention aux courbes peridiques.
-       if ( myBSplineCurve->IsPeriodic() && Index1 == Nb )
+       if ( myBSplineCurve->IsPeriodic111() && Index1 == Nb )
         Index1 = 1;
 
        if ( Index2 - Index1 <= 0) {
@@ -343,10 +343,10 @@ Standard_Integer Geom2dAdaptor_Curve::NbIntervals(const GeomAbs_Shape S) const
          myBSplineCurve->Knots(TK);
          myBSplineCurve->Multiplicities(TM);
          BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,myFirst,
-                                   myBSplineCurve->IsPeriodic(),
+                                   myBSplineCurve->IsPeriodic111(),
                                    1,Nb,Index1,newFirst);
          BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,myLast,
-                                   myBSplineCurve->IsPeriodic(),
+                                   myBSplineCurve->IsPeriodic111(),
                                    1,Nb,Index2,newLast);
 
          // On decale eventuellement les indices  
@@ -447,10 +447,10 @@ void Geom2dAdaptor_Curve::Intervals(TColStd_Array1OfReal& T,
          myBSplineCurve->Knots(TK);
          myBSplineCurve->Multiplicities(TM);
          BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,myFirst,
-                                   myBSplineCurve->IsPeriodic(),
+                                   myBSplineCurve->IsPeriodic111(),
                                    1,Nb,Index1,newFirst);
          BSplCLib::LocateParameter(myBSplineCurve->Degree(),TK,TM,myLast,
-                                   myBSplineCurve->IsPeriodic(),
+                                   myBSplineCurve->IsPeriodic111(),
                                    1,Nb,Index2,newLast);
 
 
@@ -543,7 +543,7 @@ Standard_Boolean Geom2dAdaptor_Curve::IsClosed() const
 
 Standard_Boolean Geom2dAdaptor_Curve::IsPeriodic() const 
 {
-  return myCurve->IsPeriodic();
+  return myCurve->IsPeriodic111();
 }
 
 //=======================================================================
index 84bd040e18622062917363c4aac2f010a3a63064..91ad8630cac3fffc981c9d36ae3923ea074e06f3 100644 (file)
@@ -142,7 +142,7 @@ const Standard_Boolean               SameOrientation
 
   NewCurve->Segment(C->Knot(FirstK),C->Knot(LastK));
 
-  if (C->IsPeriodic()) {
+  if (C->IsPeriodic111()) {
     if (!SameOrientation) NewCurve->Reverse();
   }
   else {
@@ -174,7 +174,7 @@ const Standard_Boolean               SameOrientation
 
   C1->Segment(FirstU, LastU);
 
-  if (C->IsPeriodic()) {
+  if (C->IsPeriodic111()) {
      if (!SameOrientation) C1->Reverse();
    }
   else {
@@ -207,7 +207,7 @@ const Convert_ParameterisationType  Parameterisation)
 
     // Si la courbe n'est pas vraiment restreinte, on ne risque pas 
     // le Raise dans le BS->Segment.
-    if (!Curv->IsPeriodic()) {     
+    if (!Curv->IsPeriodic111()) {     
       if (U1 < Curv->FirstParameter())
        U1 =  Curv->FirstParameter();
       if (U2 > Curv->LastParameter())
index 360582a96eb41a3b685225bdfc94cf2fda31468f..8b27b02d194ddd921a5135a5e075c1742099675b 100644 (file)
@@ -34,7 +34,7 @@ Geom2dConvert_BSplineCurveToBezierCurve::Geom2dConvert_BSplineCurveToBezierCurve
   // periodic curve can't be converted correctly by two main reasons:
   // last pole (equal to first one) is missing;
   // poles recomputation using default boor scheme is fails.
-  if(myCurve->IsPeriodic()) myCurve->SetNotPeriodic();
+  if(myCurve->IsPeriodic111()) myCurve->SetNotPeriodic();
   Standard_Real Uf = myCurve->FirstParameter();
   Standard_Real Ul = myCurve->LastParameter();
   myCurve->Segment(Uf,Ul);
@@ -63,7 +63,7 @@ Geom2dConvert_BSplineCurveToBezierCurve::Geom2dConvert_BSplineCurveToBezierCurve
 
   Standard_Integer I1, I2;
   myCurve = Handle(Geom2d_BSplineCurve)::DownCast(BasisCurve->Copy());
-  if(myCurve->IsPeriodic()) myCurve->SetNotPeriodic();
+  if(myCurve->IsPeriodic111()) myCurve->SetNotPeriodic();
 
   myCurve->LocateU(U1, PTol, I1, I2);
   if (I1==I2) { // On est sur le noeud
index 4d004faca3f62f8d97e9277d1557ef083250366a..210483eb2a1521338e43501fc1e6e0f3f42be171 100644 (file)
@@ -641,7 +641,7 @@ Handle(Geom_Curve) GeomLib::To3d (const gp_Ax2&               Position,
     Standard_Integer Nbpoles   = CBSpl2d->NbPoles ();
     Standard_Integer Nbknots   = CBSpl2d->NbKnots ();
     Standard_Integer TheDegree = CBSpl2d->Degree ();
-    Standard_Boolean IsPeriodic = CBSpl2d->IsPeriodic();
+    Standard_Boolean IsPeriodic = CBSpl2d->IsPeriodic111();
     TColgp_Array1OfPnt2d Poles2d (1, Nbpoles);
     CBSpl2d->Poles (Poles2d);
     TColgp_Array1OfPnt Poles3d (1, Nbpoles);
@@ -962,14 +962,7 @@ void GeomLib::SameRange(const Standard_Real         Tolerance,
   else 
   { // On segmente le resultat
     Handle(Geom2d_TrimmedCurve) TC;
-    Handle(Geom2d_Curve) aCCheck = CurvePtr;
-
-    if(aCCheck->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve)))
-    {
-      aCCheck = Handle(Geom2d_TrimmedCurve)::DownCast(aCCheck)->BasisCurve();
-    }
-
-    if(aCCheck->IsPeriodic())
+    if (CurvePtr->IsPeriodic111())
     {
       if(Abs(LastOnCurve - FirstOnCurve) > Precision::PConfusion())
       {
index b51028d2fc7d3dbb37f96b58118cca991b923397..9d4cf1984d90c63eb379ec41d31cd5474652ef8f 100644 (file)
@@ -193,6 +193,21 @@ public:
   Standard_EXPORT static void IsClosed(const Handle(Geom_Surface)& S, const Standard_Real Tol,
                                        Standard_Boolean& isUClosed, Standard_Boolean& isVClosed);
 
+  //! This method defines if the ends of the given curve are
+  //! coincided with given tolerance.
+  //! This is a template-method. Therefore, it can be applied to 
+  //! 2D- and 3D-curve and to Adaptor-HCurve.
+  template <typename TypeCurve>
+  Standard_EXPORT static Standard_Boolean IsClosed(const Handle(TypeCurve)& theCur,
+                                                   const Standard_Real theTol)
+  {
+    const Standard_Real aFPar = theCur->FirstParameter(),
+                        aLPar = theCur->LastParameter();
+
+    return (theCur->Value(aFPar).SquareDistance(theCur->Value(aLPar)) < theTol*theTol);
+  }
+
+
   //! Returns true if the poles of U1 isoline and the poles of
   //! U2 isoline of surface are identical according to tolerance criterion.
   //! For rational surfaces Weights(i)*Poles(i) are checked.
index 958c9996bb990dd038bafb2756d331c495d5d225..b4600761c4372f710768a1ab8eca5f9157ad5096 100644 (file)
@@ -46,7 +46,7 @@ GeomLib_Check2dBSplineCurve::GeomLib_Check2dBSplineCurve(const Handle(Geom2d_BSp
     vector_magnitude ;
   num_poles = myCurve->NbPoles() ;
   
-  if (( ! myCurve->IsPeriodic() )&& num_poles >= 4) {
+  if (( ! myCurve->IsPeriodic111() )&& num_poles >= 4) {
     
     gp_Vec2d tangent, tangent_normalized,
       a_vector, avector_normalized;
index d8c61cd84ab443af9e326b930b643d6f5532d841..5e6362089be9685a61a7a7c15b85adb87382172c 100644 (file)
@@ -145,10 +145,9 @@ Handle(Geom2d_Curve) GeomProjLib::Curve2d(const Handle(Geom_Curve)& C,
   }
 
   if ( C->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)) ) {
-    Handle(Geom_TrimmedCurve) CTrim = Handle(Geom_TrimmedCurve)::DownCast(C);
-    Standard_Real U1 = CTrim->FirstParameter();
-    Standard_Real U2 = CTrim->LastParameter();
-    if (!G2dC->IsPeriodic())
+    Standard_Real U1 = C->FirstParameter();
+    Standard_Real U2 = C->LastParameter();
+    if (!G2dC->IsPeriodic111())
     {
       U1 = Max(U1, G2dC->FirstParameter());
       U2 = Min(U2, G2dC->LastParameter());
index f1c7a0b56b2a7a72444d23bf7be4dadb387d8b8d..3bef9e132f2bbec173a67e22bc7b7f52a7538b96 100644 (file)
@@ -89,7 +89,7 @@ GeomToStep_MakeBoundedCurve::GeomToStep_MakeBoundedCurve ( const Handle(Geom2d_B
       Handle(Geom2d_BSplineCurve) Bspli = 
        Handle(Geom2d_BSplineCurve)::DownCast(C);
       // UPDATE FMA 1-04-96
-      if (C->IsPeriodic()) {
+      if (C->IsPeriodic111()) {
        Handle(Geom2d_BSplineCurve) newBspli = 
          Handle(Geom2d_BSplineCurve)::DownCast(Bspli->Copy());
        newBspli->SetNotPeriodic();
index 596f7c16dcc2bdb950bfe38b19a4b24a0035e6c6..0e2c62aefa5309a4c15003b7d547cfd0ee6890d4 100644 (file)
@@ -343,7 +343,7 @@ static void Print(const Handle(Geom2d_BSplineCurve)& B,
       OS << " rational";
   }
 
-  Standard_Boolean periodic = B->IsPeriodic();
+  Standard_Boolean periodic = B->IsPeriodic111();
   if (compact)
     OS << (periodic ? 1 : 0) << " ";
   else {
index f589099f980d735d34fd7319872566f72d5803a3..591af679edb09deb1338c6ee6cb4ce592c4f5f99 100644 (file)
@@ -90,7 +90,7 @@ static void HermiteCoeff(const Handle(Geom2d_BSplineCurve)& BS,
   BS->Weights(Weights);
   BS->Multiplicities(Mults);
   Degree   = BS->Degree();
-  Periodic = BS->IsPeriodic();
+  Periodic = BS->IsPeriodic111();
   Index0   = BS->FirstUKnotIndex();
   Index1   = BS->LastUKnotIndex()-1;
 
index e07ba0e88a7577685b205714ce2b531a642682bb..31a386cb9ba8df64de9db5b7d196f1559ca46d72 100644 (file)
@@ -320,10 +320,12 @@ void IGESToBRep_IGESBoundary::ReverseCurves3d (const Handle(ShapeExtend_WireData
   for (Standard_Integer i = 1; i <= sewd->NbEdges(); i++) {
     TopoDS_Edge oldedge = sewd->Edge (i), newedge;
     Standard_Real p1, p2;
+
+    // Trimmed curve is never returned
     Handle(Geom2d_Curve) curve = BRep_Tool::CurveOnSurface (oldedge, face, p1, p2);
 
     // skl 24.04.2002 for OCC314
-    if(curve->IsPeriodic())
+    if(curve->IsPeriodic111())
       ShapeBuild_Edge().MakeEdge (newedge, curve->Reversed(), face,
                                   curve->ReversedParameter (p2),
                                   curve->ReversedParameter (p1));
index 759e5dda91a3101afa25754edbd3240c87b05ed5..0e35b94dd49a15d16af5ce7a5a801cf43611d8f6 100644 (file)
@@ -2093,7 +2093,7 @@ Standard_Boolean IsCurveValid (const Handle(Geom2d_Curve)& thePCurve)
   Standard_Real pf = 0., pl = 0.;
   gp_Pnt2d pntf, pntl;
 
-  if(!thePCurve->IsClosed() && !thePCurve->IsPeriodic()) {
+  if(!thePCurve->IsClosed() && !thePCurve->IsPeriodic111()) {
     pf = thePCurve->FirstParameter();
     pl = thePCurve->LastParameter();
     pntf = thePCurve->Value(pf);
index eb5b68352e47e08c54116e6fe93a3dcfc773f544..5305b38dfb798f3f4caf4b2bd444d170d83b2a0c 100644 (file)
@@ -506,11 +506,11 @@ Standard_Boolean MAT2d_Tool2d::TrimBisector
   Handle(Geom2d_TrimmedCurve) bisector = 
     ChangeGeomBis(abisector->BisectorNumber()).ChangeValue();
 
-  if(bisector->BasisCurve()->IsPeriodic() && param == Precision::Infinite()) {
-    param = bisector->FirstParameter() + 2*M_PI;
+  if(bisector->IsPeriodic111()) {
+    param = Min(bisector->FirstParameter() + bisector->Period(), param);
   }
-  if (param > bisector->BasisCurve()->LastParameter()) {
-    param = bisector->BasisCurve()->LastParameter(); 
+  if (param > bisector->LastParameter()) {
+    param = bisector->LastParameter(); 
   }
   if(bisector->FirstParameter() == param) return Standard_False;
 
@@ -527,8 +527,8 @@ Standard_Boolean MAT2d_Tool2d::TrimBisector
   const Standard_Integer      apoint)
 {
   Standard_Real Param;
-  Handle(Geom2d_TrimmedCurve) Bisector =
-    ChangeGeomBis(abisector->BisectorNumber()).ChangeValue();
+  const Handle(Geom2d_TrimmedCurve) &Bisector = 
+                  ChangeGeomBis(abisector->BisectorNumber()).ChangeValue();
 
   Handle(Bisector_Curve) Bis = Handle(Bisector_Curve)::
     DownCast(Bisector->BasisCurve());
@@ -536,8 +536,8 @@ Standard_Boolean MAT2d_Tool2d::TrimBisector
   //  Param = ParameterOnCurve(Bisector,theGeomPnts.Value(apoint));
   Param = Bis->Parameter(GeomPnt (apoint));
 
-  if (Bisector->BasisCurve()->IsPeriodic()) {
-    if (Bisector->FirstParameter() > Param) Param = Param + 2*M_PI;
+  if (Bisector->IsPeriodic111()) {
+    if (Bisector->FirstParameter() > Param) Param += Bisector->Period();
   }
   if(Bisector->FirstParameter() >= Param)return Standard_False;
   if(Bisector->LastParameter()  <  Param)return Standard_False;
@@ -587,7 +587,7 @@ Standard_Boolean MAT2d_Tool2d::Projection (const Standard_Integer IEdge   ,
     INext = (IEdge == theCircuit->NumberOfItems()) ? 1 : (IEdge + 1);
     if (theCircuit->ConnexionOn(INext)) {
       ParamMax = theCircuit->Connexion(INext)->ParameterOnFirst(); 
-      if (Curve->BasisCurve()->IsPeriodic()){
+      if (Curve->IsPeriodic111()){
         ElCLib::AdjustPeriodic(0.,2*M_PI,Eps,ParamMin,ParamMax);
       }
     }
@@ -1316,7 +1316,7 @@ IntRes2d_Domain  Domain(const Handle(Geom2d_TrimmedCurve)& Bisector1,
 
   IntRes2d_Domain Domain1(Bisector1->Value(Param1),Param1,Tolerance,
     Bisector1->Value(Param2),Param2,Tolerance);
-  if(Bisector1->BasisCurve()->IsPeriodic()) {
+  if(Bisector1->IsPeriodic111()) {
     Domain1.SetEquivalentParameters(0.,2.*M_PI);
   }
   return Domain1;
index d97d1f452ec3a5db023cffde2c151ab885ad3ca1..bf507948ebbfd4955ea253982956599e75586519 100644 (file)
@@ -1239,5 +1239,5 @@ Standard_Boolean ShapeAnalysis_Curve::IsPeriodic(const Handle(Geom2d_Curve)& the
     if (aTmpCurve->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve)))
       aTmpCurve = Handle(Geom2d_TrimmedCurve)::DownCast(aTmpCurve)->BasisCurve();
   }
-  return aTmpCurve->IsPeriodic();
+  return aTmpCurve->IsPeriodic111();
 }
index c17a4e4fcacc4eebc8996147b7c44465d2c25c27..4e90052b4b6d32a6f7b66fab84c0d347b3be83ce 100644 (file)
@@ -172,7 +172,7 @@ Standard_Boolean IsPeriodic(const Handle(Geom2d_Curve)& theCurve)
       if (aTmpCurve->IsKind(STANDARD_TYPE(Geom2d_TrimmedCurve)))
         aTmpCurve = Handle(Geom2d_TrimmedCurve)::DownCast(aTmpCurve)->BasisCurve();
   }
-  return aTmpCurve->IsPeriodic();
+  return aTmpCurve->IsPeriodic111();
 }
 
 void ShapeBuild_Edge::CopyRanges (const TopoDS_Edge& toedge, 
index b8b6b1f6eb7b7b2e2bb3c8adc896e921985881f6..56751a877834f1dfef57da4448228d0d26124466 100644 (file)
@@ -398,10 +398,10 @@ static inline void SegmentCurve (HCurve& curve,
 {
   if(curve->FirstParameter() < first - Precision::PConfusion() || 
      curve->LastParameter() > last + Precision::PConfusion()) {
-    if(curve->IsPeriodic())
-      curve->Segment(first,last);
-    else curve->Segment(Max(curve->FirstParameter(),first),
-                        Min(curve->LastParameter(),last));
+    //if(curve->IsPeriodic())
+    //  curve->Segment(first,last);
+    //else curve->Segment(Max(curve->FirstParameter(),first),
+    //                    Min(curve->LastParameter(),last));
   } 
 }
 
index acfc5f1e62f0465ae93fa3a313cd1a1597b333ee..f3fc0cab5f65de3e59cfcb721127e5e0d13f2dab 100644 (file)
@@ -935,7 +935,7 @@ ShapeFix_WireSegment ShapeFix_ComposeShell::SplitWire (ShapeFix_WireSegment &wir
     gp_Pnt2d lastPnt2d = C2d->Value(lastPar);
     gp_Pnt prevPnt = myGrid->Value ( prevPnt2d );
     gp_Pnt lastPnt = myGrid->Value ( lastPnt2d );
-    Standard_Boolean isPeriodic = C2d->IsPeriodic();
+    Standard_Boolean isPeriodic = C2d->IsPeriodic111();
     Standard_Real aPeriod = (isPeriodic ? C2d->Period() :0.);
 
     // Splitting edge
index 8aaa8cd034fff48c567abf23039ae49abb6006fe..bb512aef3f047d9f5b827c857ce6cbb4ae7fef19 100644 (file)
@@ -318,7 +318,7 @@ ShapePersistent_Geom2d_Curve::Translate(const Handle(Geom2d_BSplineCurve)& theCu
       Handle(BSpline) aPBSC = new BSpline;
       Handle(pBSpline) aPpBSC = new pBSpline;
       aPpBSC->myRational = theCurve->IsRational();
-      aPpBSC->myPeriodic = theCurve->IsPeriodic();
+      aPpBSC->myPeriodic = theCurve->IsPeriodic111();
       aPpBSC->mySpineDegree = theCurve->Degree();
       aPpBSC->myPoles = StdLPersistent_HArray1::Translate<TColgp_HArray1OfPnt2d>("PColgp_HArray1OfPnt2d", theCurve->Poles());
       if (theCurve->IsRational()) {
index 7f2444269b28a52e6e1b82d08909354f1a0141e2..98256a4a1e40c0b45723419676183ae3402ef2a0 100644 (file)
@@ -149,7 +149,7 @@ static Handle(Geom_BSplineCurve) BSplineCurve2dTo3d (const Handle(Geom2d_BSpline
     Poles3d (i) = gp_Pnt (Poles2d (i).X(), Poles2d (i).Y(), 0);
   
   Handle(Geom_BSplineCurve) BS3d = new Geom_BSplineCurve (Poles3d, Weights,
-                                                         Knots, Mults, deg, BS->IsPeriodic());
+                                                         Knots, Mults, deg, BS->IsPeriodic111());
   return BS3d;
 }