From: anv Date: Mon, 23 Mar 2015 08:23:49 +0000 (+0300) Subject: 0025763: SSP sample is unable to build the proper surface on the given cloud of points X-Git-Tag: V7_0_0_beta~558 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=ecbdb1b027cb2dd2d3545ff16d46ae9202b2c71a 0025763: SSP sample is unable to build the proper surface on the given cloud of points Some improvements to work with periodic splines --- diff --git a/src/BSplCLib/BSplCLib.cdl b/src/BSplCLib/BSplCLib.cdl index 6d51752a74..70f49b7475 100644 --- a/src/BSplCLib/BSplCLib.cdl +++ b/src/BSplCLib/BSplCLib.cdl @@ -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 diff --git a/src/BSplCLib/BSplCLib.cxx b/src/BSplCLib/BSplCLib.cxx index 54cfce7f2f..0357c7e31d 100644 --- a/src/BSplCLib/BSplCLib.cxx +++ b/src/BSplCLib/BSplCLib.cxx @@ -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); } //======================================================================= diff --git a/src/BSplCLib/BSplCLib_2.cxx b/src/BSplCLib/BSplCLib_2.cxx index f5c421640f..204755cf1d 100644 --- a/src/BSplCLib/BSplCLib_2.cxx +++ b/src/BSplCLib/BSplCLib_2.cxx @@ -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, diff --git a/src/GeomConvert/GeomConvert_1.cxx b/src/GeomConvert/GeomConvert_1.cxx index d4cb967d81..601f041c1b 100644 --- a/src/GeomConvert/GeomConvert_1.cxx +++ b/src/GeomConvert/GeomConvert_1.cxx @@ -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; }