0025763: SSP sample is unable to build the proper surface on the given cloud of points
authoranv <anv@opencascade.com>
Mon, 23 Mar 2015 08:23:49 +0000 (11:23 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 21 May 2015 10:45:14 +0000 (13:45 +0300)
Some improvements to work with periodic splines

src/BSplCLib/BSplCLib.cdl
src/BSplCLib/BSplCLib.cxx
src/BSplCLib/BSplCLib_2.cxx
src/GeomConvert/GeomConvert_1.cxx

index 6d51752..70f49b7 100644 (file)
@@ -296,7 +296,8 @@ is
 
     KnotSequence (Knots    : Array1OfReal from TColStd; 
                   Mults    : Array1OfInteger from TColStd;
-                  KnotSeq  : in out Array1OfReal from TColStd);
+                  KnotSeq  : in out Array1OfReal from TColStd;
+                  Periodic : Boolean  =  Standard_False);
                
     KnotSequence (Knots    : Array1OfReal from TColStd; 
                   Mults    : Array1OfInteger from TColStd;
@@ -1278,7 +1279,8 @@ is
                     FlatKnots                  : Array1OfReal from TColStd ;
                     Parameter                  : in Real    ;
                     FirstNonZeroBsplineIndex   : in out Integer ;
-                    BsplineBasis               : in out Matrix from math)
+                    BsplineBasis               : in out Matrix from math ;
+                     isPeriodic                 : in Boolean = Standard_False)
 
     returns Integer  ; 
     ---Purpose: This  evaluates  the Bspline  Basis  at  a
index 54cfce7..0357c7e 100644 (file)
@@ -430,9 +430,10 @@ Standard_Integer BSplCLib::KnotSequenceLength
 void BSplCLib::KnotSequence 
 (const TColStd_Array1OfReal&    Knots,
  const TColStd_Array1OfInteger& Mults,
- TColStd_Array1OfReal&          KnotSeq)
+ TColStd_Array1OfReal&          KnotSeq,
+ const Standard_Boolean         Periodic)
 {
-  BSplCLib::KnotSequence(Knots,Mults,0,Standard_False,KnotSeq);
+  BSplCLib::KnotSequence(Knots,Mults,0,Periodic,KnotSeq);
 }
 
 //=======================================================================
index f5c4216..204755c 100644 (file)
@@ -438,7 +438,8 @@ BSplCLib::EvalBsplineBasis
  const  TColStd_Array1OfReal&         FlatKnots,
  const  Standard_Real                 Parameter,
  Standard_Integer&             FirstNonZeroBsplineIndex,
- math_Matrix&                  BsplineBasis)
+ math_Matrix&                  BsplineBasis,
+ Standard_Boolean              isPeriodic)
 {
   // the matrix must have at least DerivativeRequest + 1
   //   row and Order columns
@@ -497,7 +498,7 @@ BSplCLib::EvalBsplineBasis
   BSplCLib::LocateParameter(Order - 1, 
                            FlatKnots,
                            Parameter,
-                           Standard_False
+                           isPeriodic
                            Order, 
                            NumPoles+1, 
                            ii,
index d4cb967..601f041 100644 (file)
@@ -702,7 +702,10 @@ Handle(Geom_BSplineSurface) GeomConvert::SurfaceToBSplineSurface
         if (V2 > vmax)
           V2 = vmax;
       }
-      BS->Segment (U1, U2, V1, V2);
+      if (BS->IsUPeriodic() || BS->IsVPeriodic())
+        BS->CheckAndSegment (U1, U2, V1, V2);
+      else
+        BS->Segment (U1, U2, V1, V2);
       TheSurface = BS;
     }