1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0029915: Porting to VC 2017 : Regressions in Modeling Algorithms on VC 2017

Methods GeomConvert::ConcatG1, GeomConvert::ConcatC1, Geom2dConvert::ConcatG1, Geom2dConvert::ConcatC1 are corrected to prevent exceeding maximum degree of BSpline curve in case of closed contour.
This commit is contained in:
jgv 2018-07-17 21:16:35 +03:00 committed by bugmaster
parent 31e8d3c185
commit 4a3610588f
8 changed files with 183 additions and 50 deletions

View File

@ -1608,3 +1608,6 @@ so that related methods have been removed from AIS_InteractiveContext interface:
A set of deprecated methods previously related to Local Context and now redirecting to other methods has been preserved to simplify porting; they will be removed in next release.
@subsection upgrade_740_extremaalgo Changes in behavior of Convert algorithms
Now methods *GeomConvert::ConcatG1*, *GeomConvert::ConcatC1*, *Geom2dConvert::ConcatG1*, *Geom2dConvert::ConcatC1* modify the input argument representing the flag of closedness.

View File

@ -939,7 +939,7 @@ private:
void Geom2dConvert::ConcatG1(TColGeom2d_Array1OfBSplineCurve& ArrayOfCurves,
const TColStd_Array1OfReal& ArrayOfToler,
Handle(TColGeom2d_HArray1OfBSplineCurve) & ArrayOfConcatenated,
const Standard_Boolean ClosedFlag,
Standard_Boolean& ClosedFlag,
const Standard_Real ClosedTolerance)
{Standard_Integer nb_curve=ArrayOfCurves.Length(),
@ -1013,6 +1013,14 @@ void Geom2dConvert::ConcatG1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
Standard_Real aPolynomialCoefficient[3];
Standard_Boolean NeedDoubleDegRepara = Need2DegRepara(ArrayOfCurves);
if (nb_group==1 && ClosedFlag && NeedDoubleDegRepara)
{
Curve1 = ArrayOfCurves(nb_curve-1);
if (Curve1->Degree() > Geom2d_BSplineCurve::MaxDegree()/2)
ClosedFlag = Standard_False;
}
if ((nb_group==1) && (ClosedFlag)){ //traitement d'un cas particulier
indexmin=Indexmin(ArrayOfCurves);
if (indexmin!=(ArrayOfCurves.Length()-1))
@ -1024,8 +1032,8 @@ void Geom2dConvert::ConcatG1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
Curve2=ArrayOfCurves(0);
for (j=1;j<=nb_curve-1;j++){ //boucle secondaire a l'interieur de chaque groupe
Curve1=ArrayOfCurves(j);
if ( (j==(nb_curve-1)) &&(Need2DegRepara(ArrayOfCurves))){
const Standard_Integer aNewCurveDegree = Min(2 * Curve1->Degree(), Geom2d_BSplineCurve::MaxDegree());
if ( (j==(nb_curve-1)) && (NeedDoubleDegRepara)){
const Standard_Integer aNewCurveDegree = 2 * Curve1->Degree();
Curve2->D1(Curve2->LastParameter(),Pint,Vec1);
Curve1->D1(Curve1->FirstParameter(),Pint,Vec2);
lambda=Vec2.Magnitude()/Vec1.Magnitude();
@ -1159,7 +1167,7 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
const TColStd_Array1OfReal& ArrayOfToler,
Handle(TColStd_HArray1OfInteger)& ArrayOfIndices,
Handle(TColGeom2d_HArray1OfBSplineCurve) & ArrayOfConcatenated,
const Standard_Boolean ClosedFlag,
Standard_Boolean& ClosedFlag,
const Standard_Real ClosedTolerance)
{
ConcatC1(ArrayOfCurves,
@ -1179,7 +1187,7 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
const TColStd_Array1OfReal& ArrayOfToler,
Handle(TColStd_HArray1OfInteger)& ArrayOfIndices,
Handle(TColGeom2d_HArray1OfBSplineCurve) & ArrayOfConcatenated,
const Standard_Boolean ClosedFlag,
Standard_Boolean& ClosedFlag,
const Standard_Real ClosedTolerance,
const Standard_Real AngularTolerance)
@ -1260,6 +1268,14 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
Pretreatment(ArrayOfCurves);
Standard_Real aPolynomialCoefficient[3];
Standard_Boolean NeedDoubleDegRepara = Need2DegRepara(ArrayOfCurves);
if (nb_group==1 && ClosedFlag && NeedDoubleDegRepara)
{
Curve1 = ArrayOfCurves(nb_curve-1);
if (Curve1->Degree() > Geom2d_BSplineCurve::MaxDegree()/2)
ClosedFlag = Standard_False;
}
if ((nb_group==1) && (ClosedFlag)){ //traitement d'un cas particulier
ArrayOfIndices->SetValue(0,0);
ArrayOfIndices->SetValue(1,0);
@ -1277,12 +1293,12 @@ void Geom2dConvert::ConcatC1(TColGeom2d_Array1OfBSplineCurve& ArrayOf
else
Curve1=ArrayOfCurves(j);
const Standard_Integer aNewCurveDegree = Min(2 * Curve1->Degree(), Geom2d_BSplineCurve::MaxDegree());
const Standard_Integer aNewCurveDegree = 2 * Curve1->Degree();
if (j==0) //initialisation en debut de groupe
Curve2=Curve1;
else{
if ( (j==(nb_curve-1)) &&(Need2DegRepara(ArrayOfCurves))){
if ( (j==(nb_curve-1)) && (NeedDoubleDegRepara)){
Curve2->D1(Curve2->LastParameter(),Pint,Vec1);
Curve1->D1(Curve1->FirstParameter(),Pint,Vec2);
lambda=Vec2.Magnitude()/Vec1.Magnitude();
@ -1463,8 +1479,8 @@ void Geom2dConvert::C0BSplineToC1BSplineCurve(Handle(Geom2d_BSplineCurve)& BS,
BS->D1(BS->FirstParameter(),point1,V1); //a verifier
BS->D1(BS->LastParameter(),point2,V2);
if ((point1.SquareDistance(point2) < gp::Resolution()) &&
if ((point1.SquareDistance(point2) < tolerance) &&
(V1.IsParallel(V2, anAngularToler)))
{
closed_flag = Standard_True;
@ -1555,7 +1571,7 @@ void Geom2dConvert::C0BSplineToArrayOfC1BSplineCurve(const Handle(Geom2d_BSpline
BS->D1(BS->FirstParameter(),point1,V1);
BS->D1(BS->LastParameter(),point2,V2);
if (((point1.SquareDistance(point2) < gp::Resolution())) &&
if (((point1.SquareDistance(point2) < Tolerance)) &&
(V1.IsParallel(V2, AngularTolerance)))
{
closed_flag = Standard_True;

View File

@ -83,7 +83,10 @@ public:
//! Raised if FromK1 or ToK2 are out of the bounds
//! [FirstUKnotIndex, LastUKnotIndex]
//! Raised if FromK1 = ToK2
Standard_EXPORT static Handle(Geom2d_BSplineCurve) SplitBSplineCurve (const Handle(Geom2d_BSplineCurve)& C, const Standard_Integer FromK1, const Standard_Integer ToK2, const Standard_Boolean SameOrientation = Standard_True);
Standard_EXPORT static Handle(Geom2d_BSplineCurve) SplitBSplineCurve (const Handle(Geom2d_BSplineCurve)& C,
const Standard_Integer FromK1,
const Standard_Integer ToK2,
const Standard_Boolean SameOrientation = Standard_True);
//! This function computes the segment of B-spline curve between the
@ -101,7 +104,11 @@ public:
//! curve (The tolerance criterion is ParametricTolerance).
//! Raised if Abs (FromU1 - ToU2) <= ParametricTolerance
//! Raised if ParametricTolerance < Resolution from gp.
Standard_EXPORT static Handle(Geom2d_BSplineCurve) SplitBSplineCurve (const Handle(Geom2d_BSplineCurve)& C, const Standard_Real FromU1, const Standard_Real ToU2, const Standard_Real ParametricTolerance, const Standard_Boolean SameOrientation = Standard_True);
Standard_EXPORT static Handle(Geom2d_BSplineCurve) SplitBSplineCurve (const Handle(Geom2d_BSplineCurve)& C,
const Standard_Real FromU1,
const Standard_Real ToU2,
const Standard_Real ParametricTolerance,
const Standard_Boolean SameOrientation = Standard_True);
//! This function converts a non infinite curve from
//! Geom into a B-spline curve. C must be an ellipse or a
@ -167,7 +174,8 @@ public:
//! respectively the first and the last parameters of the
//! trimmed curve (this method of parameterization
//! cannot be used to convert a quasi-complete circle or ellipse).
Standard_EXPORT static Handle(Geom2d_BSplineCurve) CurveToBSplineCurve (const Handle(Geom2d_Curve)& C, const Convert_ParameterisationType Parameterisation = Convert_TgtThetaOver2);
Standard_EXPORT static Handle(Geom2d_BSplineCurve) CurveToBSplineCurve (const Handle(Geom2d_Curve)& C,
const Convert_ParameterisationType Parameterisation = Convert_TgtThetaOver2);
//! This Method concatenates G1 the ArrayOfCurves as far
//! as it is possible.
@ -175,11 +183,17 @@ public:
//! ArrayOfToler contains the biggest tolerance of the two
//! points shared by two consecutives curves.
//! Its dimension: [0..N-2]
//! ClosedTolerance indicates if the ArrayOfCurves is closed.
//! ClosedFlag indicates if the ArrayOfCurves is closed.
//! In this case ClosedTolerance contains the biggest tolerance
//! of the two points which are at the closure.
//! Otherwise its value is 0.0
Standard_EXPORT static void ConcatG1 (TColGeom2d_Array1OfBSplineCurve& ArrayOfCurves, const TColStd_Array1OfReal& ArrayOfToler, Handle(TColGeom2d_HArray1OfBSplineCurve)& ArrayOfConcatenated, const Standard_Boolean ClosedFlag, const Standard_Real ClosedTolerance);
//! ClosedFlag becomes False on the output
//! if it is impossible to build closed curve.
Standard_EXPORT static void ConcatG1 (TColGeom2d_Array1OfBSplineCurve& ArrayOfCurves,
const TColStd_Array1OfReal& ArrayOfToler,
Handle(TColGeom2d_HArray1OfBSplineCurve)& ArrayOfConcatenated,
Standard_Boolean& ClosedFlag,
const Standard_Real ClosedTolerance);
//! This Method concatenates C1 the ArrayOfCurves as far
//! as it is possible.
@ -187,11 +201,18 @@ public:
//! ArrayOfToler contains the biggest tolerance of the two
//! points shared by two consecutives curves.
//! Its dimension: [0..N-2]
//! ClosedTolerance indicates if the ArrayOfCurves is closed.
//! ClosedFlag indicates if the ArrayOfCurves is closed.
//! In this case ClosedTolerance contains the biggest tolerance
//! of the two points which are at the closure.
//! Otherwise its value is 0.0
Standard_EXPORT static void ConcatC1 (TColGeom2d_Array1OfBSplineCurve& ArrayOfCurves, const TColStd_Array1OfReal& ArrayOfToler, Handle(TColStd_HArray1OfInteger)& ArrayOfIndices, Handle(TColGeom2d_HArray1OfBSplineCurve)& ArrayOfConcatenated, const Standard_Boolean ClosedFlag, const Standard_Real ClosedTolerance);
//! ClosedFlag becomes False on the output
//! if it is impossible to build closed curve.
Standard_EXPORT static void ConcatC1 (TColGeom2d_Array1OfBSplineCurve& ArrayOfCurves,
const TColStd_Array1OfReal& ArrayOfToler,
Handle(TColStd_HArray1OfInteger)& ArrayOfIndices,
Handle(TColGeom2d_HArray1OfBSplineCurve)& ArrayOfConcatenated,
Standard_Boolean& ClosedFlag,
const Standard_Real ClosedTolerance);
//! This Method concatenates C1 the ArrayOfCurves as far
//! as it is possible.
@ -199,29 +220,43 @@ public:
//! ArrayOfToler contains the biggest tolerance of the two
//! points shared by two consecutives curves.
//! Its dimension: [0..N-2]
//! ClosedTolerance indicates if the ArrayOfCurves is closed.
//! ClosedFlag indicates if the ArrayOfCurves is closed.
//! In this case ClosedTolerance contains the biggest tolerance
//! of the two points which are at the closure.
//! Otherwise its value is 0.0
Standard_EXPORT static void ConcatC1 (TColGeom2d_Array1OfBSplineCurve& ArrayOfCurves, const TColStd_Array1OfReal& ArrayOfToler, Handle(TColStd_HArray1OfInteger)& ArrayOfIndices, Handle(TColGeom2d_HArray1OfBSplineCurve)& ArrayOfConcatenated, const Standard_Boolean ClosedFlag, const Standard_Real ClosedTolerance, const Standard_Real AngularTolerance);
//! ClosedFlag becomes False on the output
//! if it is impossible to build closed curve.
Standard_EXPORT static void ConcatC1 (TColGeom2d_Array1OfBSplineCurve& ArrayOfCurves,
const TColStd_Array1OfReal& ArrayOfToler,
Handle(TColStd_HArray1OfInteger)& ArrayOfIndices,
Handle(TColGeom2d_HArray1OfBSplineCurve)& ArrayOfConcatenated,
Standard_Boolean& ClosedFlag,
const Standard_Real ClosedTolerance,
const Standard_Real AngularTolerance);
//! This Method reduces as far as it is possible the
//! multiplicities of the knots of the BSpline BS.(keeping the geometry).
//! It returns a new BSpline which could still be C0.
//! tolerance is a geometrical tolerance
Standard_EXPORT static void C0BSplineToC1BSplineCurve (Handle(Geom2d_BSplineCurve)& BS, const Standard_Real Tolerance);
Standard_EXPORT static void C0BSplineToC1BSplineCurve (Handle(Geom2d_BSplineCurve)& BS,
const Standard_Real Tolerance);
//! This Method reduces as far as it is possible the
//! multiplicities of the knots of the BSpline BS.(keeping the geometry).
//! It returns an array of BSpline C1.
//! Tolerance is a geometrical tolerance
Standard_EXPORT static void C0BSplineToArrayOfC1BSplineCurve (const Handle(Geom2d_BSplineCurve)& BS, Handle(TColGeom2d_HArray1OfBSplineCurve)& tabBS, const Standard_Real Tolerance);
Standard_EXPORT static void C0BSplineToArrayOfC1BSplineCurve (const Handle(Geom2d_BSplineCurve)& BS,
Handle(TColGeom2d_HArray1OfBSplineCurve)& tabBS,
const Standard_Real Tolerance);
//! This Method reduces as far as it is possible the
//! multiplicities of the knots of the BSpline BS.(keeping the geometry).
//! It returns an array of BSpline C1.
//! tolerance is a geometrical tolerance
Standard_EXPORT static void C0BSplineToArrayOfC1BSplineCurve (const Handle(Geom2d_BSplineCurve)& BS, Handle(TColGeom2d_HArray1OfBSplineCurve)& tabBS, const Standard_Real AngularTolerance, const Standard_Real Tolerance);
Standard_EXPORT static void C0BSplineToArrayOfC1BSplineCurve (const Handle(Geom2d_BSplineCurve)& BS,
Handle(TColGeom2d_HArray1OfBSplineCurve)& tabBS,
const Standard_Real AngularTolerance,
const Standard_Real Tolerance);

View File

@ -785,7 +785,7 @@ private:
void GeomConvert::ConcatG1(TColGeom_Array1OfBSplineCurve& ArrayOfCurves,
const TColStd_Array1OfReal& ArrayOfToler,
Handle(TColGeom_HArray1OfBSplineCurve) & ArrayOfConcatenated,
const Standard_Boolean ClosedG1Flag,
Standard_Boolean& ClosedG1Flag,
const Standard_Real ClosedTolerance)
{Standard_Integer nb_curve=ArrayOfCurves.Length(),
@ -855,6 +855,14 @@ private:
Pretreatment(ArrayOfCurves);
Standard_Real aPolynomialCoefficient[3];
Standard_Boolean NeedDoubleDegRepara = Need2DegRepara(ArrayOfCurves);
if (nb_group==1 && ClosedG1Flag && NeedDoubleDegRepara)
{
Curve1 = ArrayOfCurves(nb_curve-1);
if (Curve1->Degree() > Geom2d_BSplineCurve::MaxDegree()/2)
ClosedG1Flag = Standard_False;
}
if ((nb_group==1) && (ClosedG1Flag)){ //treatment of a particular case
indexmin=Indexmin(ArrayOfCurves);
if (indexmin!=(ArrayOfCurves.Length()-1))
@ -866,7 +874,7 @@ private:
Curve2=ArrayOfCurves(0);
for (j=1;j<=nb_curve-1;j++){ //secondary loop inside each group
Curve1=ArrayOfCurves(j);
if ( (j==(nb_curve-1)) &&(Need2DegRepara(ArrayOfCurves))){
if ( (j==(nb_curve-1)) && (NeedDoubleDegRepara)){
Curve2->D1(Curve2->LastParameter(),Pint,Vec1);
Curve1->D1(Curve1->FirstParameter(),Pint,Vec2);
lambda=Vec2.Magnitude()/Vec1.Magnitude();
@ -983,7 +991,7 @@ void GeomConvert::ConcatC1(TColGeom_Array1OfBSplineCurve& ArrayOfCurv
const TColStd_Array1OfReal& ArrayOfToler,
Handle(TColStd_HArray1OfInteger)& ArrayOfIndices,
Handle(TColGeom_HArray1OfBSplineCurve)& ArrayOfConcatenated,
const Standard_Boolean ClosedG1Flag,
Standard_Boolean& ClosedG1Flag,
const Standard_Real ClosedTolerance)
{
ConcatC1(ArrayOfCurves,
@ -1003,7 +1011,7 @@ void GeomConvert::ConcatC1(TColGeom_Array1OfBSplineCurve& ArrayOfCurv
const TColStd_Array1OfReal& ArrayOfToler,
Handle(TColStd_HArray1OfInteger)& ArrayOfIndices,
Handle(TColGeom_HArray1OfBSplineCurve)& ArrayOfConcatenated,
const Standard_Boolean ClosedG1Flag,
Standard_Boolean& ClosedG1Flag,
const Standard_Real ClosedTolerance,
const Standard_Real AngularTolerance)
@ -1082,6 +1090,14 @@ void GeomConvert::ConcatC1(TColGeom_Array1OfBSplineCurve& ArrayOfCurv
Pretreatment(ArrayOfCurves);
Standard_Real aPolynomialCoefficient[3];
Standard_Boolean NeedDoubleDegRepara = Need2DegRepara(ArrayOfCurves);
if (nb_group==1 && ClosedG1Flag && NeedDoubleDegRepara)
{
Curve1 = ArrayOfCurves(nb_curve-1);
if (Curve1->Degree() > Geom2d_BSplineCurve::MaxDegree()/2)
ClosedG1Flag = Standard_False;
}
if ((nb_group==1) && (ClosedG1Flag)){ //treatment of a particular case
ArrayOfIndices->SetValue(0,0);
ArrayOfIndices->SetValue(1,0);
@ -1101,7 +1117,7 @@ void GeomConvert::ConcatC1(TColGeom_Array1OfBSplineCurve& ArrayOfCurv
if (j==0) //initialisation at the begining of the loop
Curve2=Curve1;
else{
if ( (j==(nb_curve-1)) &&(Need2DegRepara(ArrayOfCurves))){
if ( (j==(nb_curve-1)) && (NeedDoubleDegRepara)){
Curve2->D1(Curve2->LastParameter(),Pint,Vec1);
Curve1->D1(Curve1->FirstParameter(),Pint,Vec2);
lambda=Vec2.Magnitude()/Vec1.Magnitude();

View File

@ -91,7 +91,10 @@ public:
//! Raised if FromK1 = ToK2
//! Raised if FromK1 or ToK2 are out of the bounds
//! [FirstUKnotIndex, LastUKnotIndex]
Standard_EXPORT static Handle(Geom_BSplineCurve) SplitBSplineCurve (const Handle(Geom_BSplineCurve)& C, const Standard_Integer FromK1, const Standard_Integer ToK2, const Standard_Boolean SameOrientation = Standard_True);
Standard_EXPORT static Handle(Geom_BSplineCurve) SplitBSplineCurve (const Handle(Geom_BSplineCurve)& C,
const Standard_Integer FromK1,
const Standard_Integer ToK2,
const Standard_Boolean SameOrientation = Standard_True);
//! This function computes the segment of B-spline curve between the
@ -109,7 +112,11 @@ public:
//! curve (The tolerance criterion is ParametricTolerance).
//! Raised if Abs (FromU1 - ToU2) <= ParametricTolerance
//! Raised if ParametricTolerance < Resolution from gp.
Standard_EXPORT static Handle(Geom_BSplineCurve) SplitBSplineCurve (const Handle(Geom_BSplineCurve)& C, const Standard_Real FromU1, const Standard_Real ToU2, const Standard_Real ParametricTolerance, const Standard_Boolean SameOrientation = Standard_True);
Standard_EXPORT static Handle(Geom_BSplineCurve) SplitBSplineCurve (const Handle(Geom_BSplineCurve)& C,
const Standard_Real FromU1,
const Standard_Real ToU2,
const Standard_Real ParametricTolerance,
const Standard_Boolean SameOrientation = Standard_True);
//! Computes the B-spline surface patche between the knots values
@ -126,7 +133,13 @@ public:
//! [FirstUKnotIndex, LastUKnotIndex]
//! FromVK1 or ToVK2 are out of the bounds
//! [FirstVKnotIndex, LastVKnotIndex]
Standard_EXPORT static Handle(Geom_BSplineSurface) SplitBSplineSurface (const Handle(Geom_BSplineSurface)& S, const Standard_Integer FromUK1, const Standard_Integer ToUK2, const Standard_Integer FromVK1, const Standard_Integer ToVK2, const Standard_Boolean SameUOrientation = Standard_True, const Standard_Boolean SameVOrientation = Standard_True);
Standard_EXPORT static Handle(Geom_BSplineSurface) SplitBSplineSurface (const Handle(Geom_BSplineSurface)& S,
const Standard_Integer FromUK1,
const Standard_Integer ToUK2,
const Standard_Integer FromVK1,
const Standard_Integer ToVK2,
const Standard_Boolean SameUOrientation = Standard_True,
const Standard_Boolean SameVOrientation = Standard_True);
//! This method splits a B-spline surface patche between the
@ -141,7 +154,11 @@ public:
//! FromK1 or ToK2 are out of the bounds
//! [FirstUKnotIndex, LastUKnotIndex] in the
//! considered parametric direction.
Standard_EXPORT static Handle(Geom_BSplineSurface) SplitBSplineSurface (const Handle(Geom_BSplineSurface)& S, const Standard_Integer FromK1, const Standard_Integer ToK2, const Standard_Boolean USplit, const Standard_Boolean SameOrientation = Standard_True);
Standard_EXPORT static Handle(Geom_BSplineSurface) SplitBSplineSurface (const Handle(Geom_BSplineSurface)& S,
const Standard_Integer FromK1,
const Standard_Integer ToK2,
const Standard_Boolean USplit,
const Standard_Boolean SameOrientation = Standard_True);
//! This method computes the B-spline surface patche between the
@ -162,7 +179,14 @@ public:
//! Raised if Abs (FromU1 - ToU2) <= ParametricTolerance or
//! Abs (FromV1 - ToV2) <= ParametricTolerance.
//! Raised if ParametricTolerance < Resolution.
Standard_EXPORT static Handle(Geom_BSplineSurface) SplitBSplineSurface (const Handle(Geom_BSplineSurface)& S, const Standard_Real FromU1, const Standard_Real ToU2, const Standard_Real FromV1, const Standard_Real ToV2, const Standard_Real ParametricTolerance, const Standard_Boolean SameUOrientation = Standard_True, const Standard_Boolean SameVOrientation = Standard_True);
Standard_EXPORT static Handle(Geom_BSplineSurface) SplitBSplineSurface (const Handle(Geom_BSplineSurface)& S,
const Standard_Real FromU1,
const Standard_Real ToU2,
const Standard_Real FromV1,
const Standard_Real ToV2,
const Standard_Real ParametricTolerance,
const Standard_Boolean SameUOrientation = Standard_True,
const Standard_Boolean SameVOrientation = Standard_True);
//! This method splits the B-spline surface S in one direction
@ -182,7 +206,12 @@ public:
//! Raises if FromParam1 or ToParam2 are out of the parametric bounds
//! of the surface in the considered direction.
//! Raises if Abs (FromParam1 - ToParam2) <= ParametricTolerance.
Standard_EXPORT static Handle(Geom_BSplineSurface) SplitBSplineSurface (const Handle(Geom_BSplineSurface)& S, const Standard_Real FromParam1, const Standard_Real ToParam2, const Standard_Boolean USplit, const Standard_Real ParametricTolerance, const Standard_Boolean SameOrientation = Standard_True);
Standard_EXPORT static Handle(Geom_BSplineSurface) SplitBSplineSurface (const Handle(Geom_BSplineSurface)& S,
const Standard_Real FromParam1,
const Standard_Real ToParam2,
const Standard_Boolean USplit,
const Standard_Real ParametricTolerance,
const Standard_Boolean SameOrientation = Standard_True);
//! This function converts a non infinite curve from
//! Geom into a B-spline curve. C must be an ellipse or a
@ -249,7 +278,8 @@ public:
//! respectively the first and the last parameters of the
//! trimmed curve (this method of parameterization
//! cannot be used to convert a quasi-complete circle or ellipse).
Standard_EXPORT static Handle(Geom_BSplineCurve) CurveToBSplineCurve (const Handle(Geom_Curve)& C, const Convert_ParameterisationType Parameterisation = Convert_TgtThetaOver2);
Standard_EXPORT static Handle(Geom_BSplineCurve) CurveToBSplineCurve (const Handle(Geom_Curve)& C,
const Convert_ParameterisationType Parameterisation = Convert_TgtThetaOver2);
//! This algorithm converts a non infinite surface from Geom
@ -268,11 +298,17 @@ public:
//! ArrayOfToler contains the biggest tolerance of the two
//! points shared by two consecutives curves.
//! Its dimension: [0..N-2]
//! ClosedG1 indicates if the ArrayOfCurves is closed.
//! In this case ClosedG1 contains the biggest tolerance
//! ClosedFlag indicates if the ArrayOfCurves is closed.
//! In this case ClosedTolerance contains the biggest tolerance
//! of the two points which are at the closure.
//! Otherwise its value is 0.0
Standard_EXPORT static void ConcatG1 (TColGeom_Array1OfBSplineCurve& ArrayOfCurves, const TColStd_Array1OfReal& ArrayOfToler, Handle(TColGeom_HArray1OfBSplineCurve)& ArrayOfConcatenated, const Standard_Boolean ClosedG1Flag, const Standard_Real ClosedTolerance);
//! ClosedFlag becomes False on the output
//! if it is impossible to build closed curve.
Standard_EXPORT static void ConcatG1 (TColGeom_Array1OfBSplineCurve& ArrayOfCurves,
const TColStd_Array1OfReal& ArrayOfToler,
Handle(TColGeom_HArray1OfBSplineCurve)& ArrayOfConcatenated,
Standard_Boolean& ClosedFlag,
const Standard_Real ClosedTolerance);
//! This Method concatenates C1 the ArrayOfCurves as far
//! as it is possible.
@ -280,11 +316,18 @@ public:
//! ArrayOfToler contains the biggest tolerance of the two
//! points shared by two consecutives curves.
//! Its dimension: [0..N-2]
//! ClosedG1 indicates if the ArrayOfCurves is closed.
//! In this case ClosedG1 contains the biggest tolerance
//! ClosedFlag indicates if the ArrayOfCurves is closed.
//! In this case ClosedTolerance contains the biggest tolerance
//! of the two points which are at the closure.
//! Otherwise its value is 0.0
Standard_EXPORT static void ConcatC1 (TColGeom_Array1OfBSplineCurve& ArrayOfCurves, const TColStd_Array1OfReal& ArrayOfToler, Handle(TColStd_HArray1OfInteger)& ArrayOfIndices, Handle(TColGeom_HArray1OfBSplineCurve)& ArrayOfConcatenated, const Standard_Boolean ClosedG1Flag, const Standard_Real ClosedTolerance);
//! ClosedFlag becomes False on the output
//! if it is impossible to build closed curve.
Standard_EXPORT static void ConcatC1 (TColGeom_Array1OfBSplineCurve& ArrayOfCurves,
const TColStd_Array1OfReal& ArrayOfToler,
Handle(TColStd_HArray1OfInteger)& ArrayOfIndices,
Handle(TColGeom_HArray1OfBSplineCurve)& ArrayOfConcatenated,
Standard_Boolean& ClosedFlag,
const Standard_Real ClosedTolerance);
//! This Method concatenates C1 the ArrayOfCurves as far
//! as it is possible.
@ -292,11 +335,19 @@ public:
//! ArrayOfToler contains the biggest tolerance of the two
//! points shared by two consecutives curves.
//! Its dimension: [0..N-2]
//! ClosedG1 indicates if the ArrayOfCurves is closed.
//! In this case ClosedG1 contains the biggest tolerance
//! ClosedFlag indicates if the ArrayOfCurves is closed.
//! In this case ClosedTolerance contains the biggest tolerance
//! of the two points which are at the closure.
//! Otherwise its value is 0.0
Standard_EXPORT static void ConcatC1 (TColGeom_Array1OfBSplineCurve& ArrayOfCurves, const TColStd_Array1OfReal& ArrayOfToler, Handle(TColStd_HArray1OfInteger)& ArrayOfIndices, Handle(TColGeom_HArray1OfBSplineCurve)& ArrayOfConcatenated, const Standard_Boolean ClosedG1Flag, const Standard_Real ClosedTolerance, const Standard_Real AngularTolerance);
//! ClosedFlag becomes False on the output
//! if it is impossible to build closed curve.
Standard_EXPORT static void ConcatC1 (TColGeom_Array1OfBSplineCurve& ArrayOfCurves,
const TColStd_Array1OfReal& ArrayOfToler,
Handle(TColStd_HArray1OfInteger)& ArrayOfIndices,
Handle(TColGeom_HArray1OfBSplineCurve)& ArrayOfConcatenated,
Standard_Boolean& ClosedFlag,
const Standard_Real ClosedTolerance,
const Standard_Real AngularTolerance);
//! This Method reduces as far as it is possible the
//! multiplicities of the knots of the BSpline BS.(keeping the
@ -305,12 +356,16 @@ public:
//! The Angular toleranceis in radians and mesures the angle of
//! the tangents on the left and on the right to decide if the
//! curve is G1 or not at a given point
Standard_EXPORT static void C0BSplineToC1BSplineCurve (Handle(Geom_BSplineCurve)& BS, const Standard_Real tolerance, const Standard_Real AngularTolerance = 1.0e-7);
Standard_EXPORT static void C0BSplineToC1BSplineCurve (Handle(Geom_BSplineCurve)& BS,
const Standard_Real tolerance,
const Standard_Real AngularTolerance = 1.0e-7);
//! This Method reduces as far as it is possible the
//! multiplicities of the knots of the BSpline BS.(keeping the geometry).
//! It returns an array of BSpline C1. tolerance is a geometrical tolerance.
Standard_EXPORT static void C0BSplineToArrayOfC1BSplineCurve (const Handle(Geom_BSplineCurve)& BS, Handle(TColGeom_HArray1OfBSplineCurve)& tabBS, const Standard_Real tolerance);
Standard_EXPORT static void C0BSplineToArrayOfC1BSplineCurve (const Handle(Geom_BSplineCurve)& BS,
Handle(TColGeom_HArray1OfBSplineCurve)& tabBS,
const Standard_Real tolerance);
//! This Method reduces as far as it is possible the
//! multiplicities of the knots of the BSpline BS.(keeping the
@ -319,7 +374,10 @@ public:
//! The Angular tolerance is in radians and mesures the angle of
//! the tangents on the left and on the right to decide if the curve
//! is C1 or not at a given point
Standard_EXPORT static void C0BSplineToArrayOfC1BSplineCurve (const Handle(Geom_BSplineCurve)& BS, Handle(TColGeom_HArray1OfBSplineCurve)& tabBS, const Standard_Real AngularTolerance, const Standard_Real tolerance);
Standard_EXPORT static void C0BSplineToArrayOfC1BSplineCurve (const Handle(Geom_BSplineCurve)& BS,
Handle(TColGeom_HArray1OfBSplineCurve)& tabBS,
const Standard_Real AngularTolerance,
const Standard_Real tolerance);

View File

@ -3901,11 +3901,12 @@ Standard_Integer OCC26446 (Draw_Interpretor& di,
aCurves.SetValue(1, aCurve2);
aTolerances.SetValue(0, aTolConf);
Standard_Boolean closed_flag = Standard_False;
GeomConvert::ConcatC1(aCurves,
aTolerances,
anIndices,
aConcatCurves,
Standard_False,
closed_flag,
aTolClosure);
Handle(Geom_BSplineCurve) aResult =

View File

@ -477,11 +477,12 @@ static TopoDS_Edge GlueEdgesWithPCurves(const TopTools_SequenceOfShape& aChain,
}
Handle(TColGeom_HArray1OfBSplineCurve) concatcurve; //array of the concatenated curves
Handle(TColStd_HArray1OfInteger) ArrayOfIndices; //array of the remining Vertex
Standard_Boolean closed_flag = Standard_False;
GeomConvert::ConcatC1(tab_c3d,
tabtolvertex,
ArrayOfIndices,
concatcurve,
Standard_False,
closed_flag,
Precision::Confusion()); //C1 concatenation
if (concatcurve->Length() > 1)
@ -523,11 +524,12 @@ static TopoDS_Edge GlueEdgesWithPCurves(const TopTools_SequenceOfShape& aChain,
}
Handle(TColGeom2d_HArray1OfBSplineCurve) concatc2d; //array of the concatenated curves
Handle(TColStd_HArray1OfInteger) ArrayOfInd2d; //array of the remining Vertex
closed_flag = Standard_False;
Geom2dConvert::ConcatC1(tab_c2d,
tabtolvertex,
ArrayOfInd2d,
concatc2d,
Standard_False,
closed_flag,
Precision::Confusion()); //C1 concatenation
if (concatc2d->Length() > 1)

View File

@ -20,5 +20,7 @@ set log [bopcurves f_1 f_2 -2d]
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
regexp {Tolerance Reached=+([-0-9.+eE]+)} ${log} full Toler
checkreal TolReached $Toler 4.60347250530349e-008 0.0 0.1
if { ${Toler} > 1.e-7} {
puts "Error: bad tolerance of result"
}