mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0022312: Translation of french commentaries in OCCT files
This commit is contained in:
@@ -53,9 +53,9 @@ FairCurve_Batten::FairCurve_Batten(const gp_Pnt2d& P1,
|
||||
if (P1.IsEqual(P2, Precision::Confusion()))
|
||||
Standard_NullValue::Raise("FairCurve : P1 and P2 are confused");
|
||||
if (Height <= 0)
|
||||
Standard_NegativeValue::Raise("FairCurve : Height is no positive");
|
||||
Standard_NegativeValue::Raise("FairCurve : Height is not positive");
|
||||
//
|
||||
// On initialise par une droite (2 poles)
|
||||
// Initialize by a straight line (2 poles)
|
||||
//
|
||||
Handle(TColStd_HArray1OfReal) Iknots = new TColStd_HArray1OfReal(1,2);
|
||||
Handle(TColStd_HArray1OfInteger) Imults = new TColStd_HArray1OfInteger(1,2);
|
||||
@@ -70,7 +70,7 @@ FairCurve_Batten::FairCurve_Batten(const gp_Pnt2d& P1,
|
||||
Ipoles->SetValue(1, P1);
|
||||
Ipoles->SetValue(2, P2);
|
||||
|
||||
// On incremente le degree
|
||||
// Increase the degree
|
||||
|
||||
Handle(TColgp_HArray1OfPnt2d) Npoles = new TColgp_HArray1OfPnt2d(1, Degree+1);
|
||||
Handle(TColStd_HArray1OfReal) Nweight = new TColStd_HArray1OfReal(1, 2);
|
||||
@@ -87,13 +87,13 @@ FairCurve_Batten::FairCurve_Batten(const gp_Pnt2d& P1,
|
||||
Nknots->ChangeArray1(),
|
||||
Nmults->ChangeArray1() );
|
||||
|
||||
// et on affecte le resultat dans nos champs
|
||||
// and impact the result in our fields
|
||||
|
||||
Poles = Npoles;
|
||||
Knots = Nknots;
|
||||
Mults = Nmults;
|
||||
|
||||
// calcul des noeuds "plats".
|
||||
// calculate "plane" nodes
|
||||
|
||||
Flatknots = new TColStd_HArray1OfReal
|
||||
(1, BSplCLib::KnotSequenceLength(Mults->Array1(), Degree, Standard_False));
|
||||
@@ -144,13 +144,13 @@ Standard_Boolean FairCurve_Batten::Compute(FairCurve_AnalysisCode& ACode,
|
||||
// ==================================================================
|
||||
{
|
||||
Standard_Boolean Ok=Standard_True, End=Standard_False;
|
||||
Standard_Real AngleMax = 0.7; // parametre reglant la fonction d'increment ( 40 degrees )
|
||||
Standard_Real AngleMin = 2*PI/100; // parametre reglant la fonction d'increment
|
||||
// un tour complet ne doit pas couter plus de 100 pas.
|
||||
Standard_Real AngleMax = 0.7; // parameter ruling the function of increment ( 40 degrees )
|
||||
Standard_Real AngleMin = 2*PI/100; // parameter ruling the function of increment
|
||||
// full passage should not cost more than 100 steps.
|
||||
Standard_Real DAngle1, DAngle2, Ratio, Fraction, Toler;
|
||||
Standard_Real OldDist, NewDist;
|
||||
|
||||
// Boucle d'Homotopie : calcul du pas et optimisation
|
||||
// Loop of Homotopy : calculation of the step and optimisation
|
||||
|
||||
while (Ok && !End) {
|
||||
DAngle1 = NewAngle1-OldAngle1;
|
||||
@@ -210,7 +210,7 @@ Standard_Boolean FairCurve_Batten::Compute(const gp_Vec2d& DeltaP1,
|
||||
Standard_Boolean Ok, OkCompute=Standard_True;
|
||||
ACode = FairCurve_OK;
|
||||
|
||||
// Deformation de la courbe par ajout d'un polynome d'interpolation
|
||||
// Deformation of the curve by adding a polynom of interpolation
|
||||
Standard_Integer L = 2 + NewConstraintOrder1 + NewConstraintOrder2, kk, ii;
|
||||
TColStd_Array1OfReal knots (1,2);
|
||||
knots(1) = 0;
|
||||
@@ -220,13 +220,13 @@ Standard_Boolean FairCurve_Batten::Compute(const gp_Vec2d& DeltaP1,
|
||||
TColgp_Array1OfPnt2d Interpolation(1,L);
|
||||
Handle(TColgp_HArray1OfPnt2d) NPoles = new TColgp_HArray1OfPnt2d(1, Poles->Length());
|
||||
|
||||
// Polynomes d'Hermites
|
||||
// Polynoms of Hermite
|
||||
math_Matrix HermiteCoef(1, L, 1, L);
|
||||
Ok = PLib::HermiteCoefficients(0,1, NewConstraintOrder1, NewConstraintOrder2,
|
||||
HermiteCoef);
|
||||
if (!Ok) return Standard_False;
|
||||
|
||||
// Definition des contraintes d'interpolation
|
||||
// Definition of constraints of interpolation
|
||||
TColgp_Array1OfXY ADelta(1,L);
|
||||
gp_Vec2d VOld(OldP1, OldP2), VNew( -(OldP1.XY()+DeltaP1.XY()) + (OldP2.XY()+DeltaP2.XY()) );
|
||||
Standard_Real DAngleRef = VNew.Angle(VOld);
|
||||
@@ -258,7 +258,7 @@ Standard_Boolean FairCurve_Batten::Compute(const gp_Vec2d& DeltaP1,
|
||||
}
|
||||
Interpolation(ii).SetXY(AuxXY);
|
||||
}
|
||||
// Conversion en BSpline de meme structure que le batten courant.
|
||||
// Conversion into BSpline of the same structure as the current batten.
|
||||
PLib::CoefficientsPoles( Interpolation, PLib::NoWeights(),
|
||||
HermitePoles, PLib::NoWeights() );
|
||||
|
||||
@@ -273,13 +273,13 @@ Standard_Boolean FairCurve_Batten::Compute(const gp_Vec2d& DeltaP1,
|
||||
DeltaCurve->InsertKnots(Knots->Array1(), Mults->Array1(), 1.e-10);
|
||||
}
|
||||
|
||||
// Sommation
|
||||
// Summing
|
||||
DeltaCurve->Poles( NPoles->ChangeArray1() );
|
||||
for (kk= NPoles->Lower(); kk<=NPoles->Upper(); kk++) {
|
||||
NPoles->ChangeValue(kk).ChangeCoord() += Poles->Value(kk).Coord();
|
||||
}
|
||||
|
||||
// Donnees intermediaires
|
||||
// Intermediary data
|
||||
|
||||
Standard_Real Angle1, Angle2, SlidingLength,
|
||||
Alph1 = OldAngle1 + DeltaAngle1,
|
||||
@@ -291,12 +291,12 @@ Standard_Boolean FairCurve_Batten::Compute(const gp_Vec2d& DeltaP1,
|
||||
P1P2 ( NPoles->Value(NPoles->Upper()).Coord()
|
||||
- NPoles->Value(NPoles->Lower()).Coord() );
|
||||
|
||||
// Angles par rapport a l'axe ox
|
||||
// Angles corresponding to axis ox
|
||||
|
||||
Angle1 = Ox.Angle(P1P2) + Alph1;
|
||||
Angle2 = -Ox.Angle(P1P2) + Alph2;
|
||||
|
||||
// Calcul de la longeur de glissement (impose ou intiale);
|
||||
// Calculation of the length of sliding (imposed or intial);
|
||||
|
||||
if (!NewFreeSliding) {
|
||||
SlidingLength = NewSlidingFactor * LReference;
|
||||
@@ -312,7 +312,7 @@ Standard_Boolean FairCurve_Batten::Compute(const gp_Vec2d& DeltaP1,
|
||||
|
||||
|
||||
|
||||
// Energie et vecteurs d'initialisation
|
||||
// Energy and vectors of initialisation
|
||||
FairCurve_BattenLaw LBatten (NewHeight, NewSlope, SlidingLength );
|
||||
FairCurve_EnergyOfBatten EBatten (Degree+1, Flatknots, NPoles,
|
||||
NewConstraintOrder1, NewConstraintOrder2,
|
||||
@@ -320,8 +320,7 @@ Standard_Boolean FairCurve_Batten::Compute(const gp_Vec2d& DeltaP1,
|
||||
Angle1, Angle2);
|
||||
math_Vector VInit (1, EBatten.NbVariables());
|
||||
|
||||
// La valeur ci-dessous donne une idee de la plus petie valeur propre
|
||||
// du critere de flexion.
|
||||
// The valeur below is the smallest value of the criterion of flexion.
|
||||
Standard_Real VConvex = 0.01 * pow(NewHeight / SlidingLength, 3);
|
||||
if (VConvex < 1.e-12) {VConvex = 1.e-12;}
|
||||
|
||||
@@ -376,18 +375,18 @@ Standard_Boolean FairCurve_Batten::Compute(const gp_Vec2d& DeltaP1,
|
||||
|
||||
Ok = EBatten.Variable(VInit);
|
||||
|
||||
// Traitement de la non convergence
|
||||
// Processing of non-convergence
|
||||
if (!Newton.IsConverged()) {
|
||||
ACode = FairCurve_NotConverged;
|
||||
}
|
||||
|
||||
|
||||
// Prevention du glissement infinie
|
||||
// Prevention of infinite sliding
|
||||
if (NewFreeSliding && VInit(VInit.Upper()) > 2*LReference)
|
||||
ACode = FairCurve_InfiniteSliding;
|
||||
|
||||
|
||||
// Insertion eventuelle de Noeuds
|
||||
// Eventual insertion of Nodes
|
||||
Standard_Boolean NewKnots = Standard_False;
|
||||
Standard_Integer NbKnots = Knots->Length();
|
||||
Standard_Real ValAngles = (Abs(OldAngle1) + Abs(OldAngle2)
|
||||
@@ -428,7 +427,7 @@ Standard_Boolean FairCurve_Batten::Compute(const gp_Vec2d& DeltaP1,
|
||||
Flatknots = FKnots;
|
||||
}
|
||||
|
||||
// Pour d'eventuels debug
|
||||
// For eventual debug
|
||||
// Newton.Dump(cout);
|
||||
|
||||
return OkCompute;
|
||||
@@ -449,7 +448,7 @@ Standard_Real FairCurve_Batten::SlidingOfReference(const Standard_Real Dist,
|
||||
{
|
||||
Standard_Real a1, a2;
|
||||
|
||||
// cas d'angle non contraints
|
||||
// case of angle without constraints
|
||||
if ( (NewConstraintOrder1 == 0) && (NewConstraintOrder2 == 0)) return Dist;
|
||||
|
||||
if (NewConstraintOrder1 == 0) a1 = Abs( Abs(NewAngle2)<PI ? Angle2/2 : PI/2);
|
||||
@@ -458,12 +457,12 @@ Standard_Real FairCurve_Batten::SlidingOfReference(const Standard_Real Dist,
|
||||
if (NewConstraintOrder2 == 0) a2 = Abs( Abs(NewAngle1)<PI ? Angle1/2 : PI/2);
|
||||
else a2 = Abs(Angle2);
|
||||
|
||||
// cas d'angle de meme signe
|
||||
// case of angle of the same sign
|
||||
if (Angle1 * Angle2 >= 0 ) {
|
||||
return Compute(Dist, a1, a2);
|
||||
}
|
||||
|
||||
// cas d'angle de signe opposes
|
||||
// case of angle of opposite sign
|
||||
else {
|
||||
Standard_Real Ratio = a1 / ( a1 + a2 );
|
||||
Standard_Real AngleMilieu = pow(1-Ratio,2) * a1 + pow(Ratio,2) * a2;
|
||||
@@ -496,10 +495,10 @@ Standard_Real FairCurve_Batten::Compute(const Standard_Real Dist,
|
||||
const Standard_Real Angle) const
|
||||
// ==================================================================
|
||||
{
|
||||
if (Angle < Precision::Angular() ) { return Dist; } // longeur du segment P1P2
|
||||
if (Angle < PI/2) { return Angle*Dist / sin(Angle); } // longueur du cercle P1P2 respectant ANGLE
|
||||
if (Angle < Precision::Angular() ) { return Dist; } // length of segment P1P2
|
||||
if (Angle < PI/2) { return Angle*Dist / sin(Angle); } // length of circle P1P2 respecting ANGLE
|
||||
if (Angle > PI) { return Sqrt(Angle*PI) * Dist;}
|
||||
else { return Angle * Dist; } // interpolation lineaire
|
||||
else { return Angle * Dist; } // linear interpolation
|
||||
}
|
||||
|
||||
// ==================================================================
|
||||
|
@@ -34,7 +34,7 @@ FairCurve_Energy::FairCurve_Energy(const Handle(TColgp_HArray1OfPnt2d)& Poles,
|
||||
MyGradient( 0, MyNbValues),
|
||||
MyHessian( 0, MyNbValues + MyNbValues*(MyNbValues+1)/2 )
|
||||
{
|
||||
// on attend des angles dans le repere (Ox,Oy)
|
||||
// chesk angles in reference (Ox,Oy)
|
||||
gp_XY L0 (Cos(Angle1), Sin(Angle1)), L1 (-Cos(Angle2), Sin(Angle2));
|
||||
MyLinearForm.SetValue(0, L0);
|
||||
MyLinearForm.SetValue(1, L1);
|
||||
@@ -78,7 +78,7 @@ void FairCurve_Energy::Gradient1(const math_Vector& Vect,
|
||||
Standard_Integer Vdeb = 3,
|
||||
Vfin = 2*MyPoles->Length()-2;
|
||||
|
||||
// .... par calcul
|
||||
// .... by calculation
|
||||
if (MyContrOrder1 >= 1) {
|
||||
gp_XY DPole (Vect(Vdeb), Vect(Vdeb+1));
|
||||
Grad(DebG) = MyLinearForm(0) * DPole;
|
||||
@@ -111,7 +111,7 @@ void FairCurve_Energy::Gradient1(const math_Vector& Vect,
|
||||
Grad(FinG+1) = MyLinearForm(1) * DPole;
|
||||
FinG -= 1;
|
||||
}
|
||||
// ... par recopie
|
||||
// ... by recopy
|
||||
for (ii=DebG; ii<=FinG; ii++) {
|
||||
Grad(ii) = Vect(Vdeb);
|
||||
Vdeb += 1;
|
||||
@@ -186,7 +186,7 @@ void FairCurve_Energy::Hessian1(const math_Vector& Vect,
|
||||
|
||||
if (MyContrOrder1 >= 1) {
|
||||
|
||||
// calcul de la colonne lambda gauche --------------------------------
|
||||
// calculate the left lambda column --------------------------------
|
||||
|
||||
jj = Vdeb-2*MyContrOrder1;
|
||||
kk=Indice(jj, jj); // X2X2
|
||||
@@ -220,7 +220,7 @@ void FairCurve_Energy::Hessian1(const math_Vector& Vect,
|
||||
}
|
||||
|
||||
if (MyContrOrder2 >= 1) {
|
||||
H(MyNbVar-MyWithAuxValue, 1) = 0; // correct si il y a moins 3 noeuds
|
||||
H(MyNbVar-MyWithAuxValue, 1) = 0; // correct if there are less than 3 nodes
|
||||
if (MyContrOrder2 == 2) {H(MyNbVar-MyWithAuxValue-1, 1) = 0;}
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ void FairCurve_Energy::Hessian1(const math_Vector& Vect,
|
||||
}
|
||||
}
|
||||
|
||||
// calcul de la ligne mu gauche -----------------------
|
||||
// calculate the left line mu ----------------------
|
||||
if (MyContrOrder1 >= 2) {
|
||||
jj = Vdeb-2*(MyContrOrder1-1);
|
||||
kk=Indice(jj, jj); // X3X3
|
||||
@@ -251,7 +251,7 @@ void FairCurve_Energy::Hessian1(const math_Vector& Vect,
|
||||
}
|
||||
|
||||
if (MyContrOrder2 >= 1) {
|
||||
H(MyNbVar-MyWithAuxValue, 2) = 0; // correct si il y a moins 3 noeuds
|
||||
H(MyNbVar-MyWithAuxValue, 2) = 0; // correct if there are less than 3 nodes
|
||||
if (MyContrOrder2 == 2) {H(MyNbVar-MyWithAuxValue-1, 2) = 0;}
|
||||
}
|
||||
Vk = Vdeb;
|
||||
@@ -269,7 +269,7 @@ void FairCurve_Energy::Hessian1(const math_Vector& Vect,
|
||||
}
|
||||
}
|
||||
|
||||
// calcul de la ligne lambda droite -----------------------
|
||||
// calculate the right lambda line -----------------------
|
||||
if (MyContrOrder2 >= 1) {
|
||||
|
||||
jj = FinH + 1;
|
||||
@@ -304,11 +304,11 @@ void FairCurve_Energy::Hessian1(const math_Vector& Vect,
|
||||
H(FinH+2, FinH+1) += Laux * MyLinearForm(1).Multiplied(Aux)
|
||||
+ (Laux.X()*MyLinearForm(1).Y() + Laux.Y()*MyLinearForm(1).X())
|
||||
* Vect(ll+jj);
|
||||
// H(FinH+2, FinH+1) = 0; // faute de mieux ... Bug dans l'expression precedente
|
||||
// H(FinH+2, FinH+1) = 0; // No better alternative. Bug in the previous expression
|
||||
}
|
||||
}
|
||||
|
||||
// calcule de la ligne mu droite -----------------------
|
||||
// calculate the right line mu -----------------------
|
||||
if (MyContrOrder2 >= 2) {
|
||||
jj = FinH + 2;
|
||||
Vk = Vfin + 2*MyContrOrder2 - 3;
|
||||
@@ -320,7 +320,7 @@ void FairCurve_Energy::Hessian1(const math_Vector& Vect,
|
||||
for (ii=DebH; ii<=FinH; ii++) {
|
||||
H(jj, ii) = MyLinearForm(1).X() * Vect(kk)
|
||||
+ MyLinearForm(1).Y() * Vect(kk+Vk);
|
||||
// update de la ligne Lambda droite
|
||||
// update the right line Lambda
|
||||
H(jj-1,ii) += Xaux*Vect(kk) + Yaux*Vect(kk+Vk);
|
||||
kk++;
|
||||
}
|
||||
@@ -329,7 +329,7 @@ void FairCurve_Energy::Hessian1(const math_Vector& Vect,
|
||||
H(jj,jj) = Cos1*Vect(kk) + CosSin1*Vect(ii) + Sin1*Vect(ii+1);
|
||||
}
|
||||
|
||||
// calcule de la ligne Variable Auxiliaire -----------------------
|
||||
// calculate the Auxiliary Variable line -----------------------
|
||||
if (MyWithAuxValue) {
|
||||
|
||||
kk = Indice(Vup, Vdeb);
|
||||
@@ -353,7 +353,7 @@ void FairCurve_Energy::Hessian1(const math_Vector& Vect,
|
||||
H(H.UpperRow(), H.UpperRow()) = Vect(kk);
|
||||
}
|
||||
|
||||
// recopie du bloc interne ---------------------------------------------
|
||||
// recopy the internal block -----------------------------------
|
||||
|
||||
kk = Indice(Vdeb, Vdeb);
|
||||
for (ii = DebH; ii <=FinH; ii++) {
|
||||
@@ -363,7 +363,7 @@ void FairCurve_Energy::Hessian1(const math_Vector& Vect,
|
||||
}
|
||||
kk += Vdeb-1;
|
||||
}
|
||||
// symetrie
|
||||
// symmetry
|
||||
for (ii = H.LowerRow(); ii <= H.UpperRow(); ii++)
|
||||
for (jj = ii+1; jj <= H.UpperRow(); jj++) H(ii,jj) = H(jj,ii);
|
||||
}
|
||||
@@ -376,11 +376,11 @@ Standard_Boolean FairCurve_Energy::Variable(math_Vector& X) const
|
||||
IndexDeb1 = MyPoles->Lower()+1,
|
||||
IndexDeb2 = X.Lower(),
|
||||
IndexFin1 = MyPoles->Upper()-1,
|
||||
IndexFin2 = X.Upper() - MyWithAuxValue; // on decremente de 1 si le glissement
|
||||
// est libre car la derniere valeur de X lui est reserve.
|
||||
IndexFin2 = X.Upper() - MyWithAuxValue; // decrease by 1 if the sliding is
|
||||
// free as the last value of X is reserved.
|
||||
|
||||
|
||||
// calculs des variables de contraintes
|
||||
// calculation of variables of constraints
|
||||
if (MyContrOrder1 >= 1) {
|
||||
X(IndexDeb2) = MyPoles->Value(MyPoles->Lower())
|
||||
.Distance( MyPoles->Value(MyPoles->Lower()+1) );
|
||||
@@ -407,9 +407,9 @@ Standard_Boolean FairCurve_Energy::Variable(math_Vector& X) const
|
||||
IndexFin1 -= 1;
|
||||
}
|
||||
|
||||
// La recopie des variables auxiliaires n'est pas realise dans la classe abstraite
|
||||
// Recopy of auxiliary variables is not done in the abstract class
|
||||
|
||||
// recopie des poles vers les variables
|
||||
// copy poles to variables
|
||||
for (ii=IndexDeb1; ii<=IndexFin1; ii++) {
|
||||
X(IndexDeb2) = MyPoles->Value(ii).X();
|
||||
X(IndexDeb2+1) = MyPoles->Value(ii).Y();
|
||||
@@ -426,11 +426,11 @@ void FairCurve_Energy::ComputePoles(const math_Vector& X)
|
||||
IndexDeb1 = MyPoles->Lower()+1,
|
||||
IndexDeb2 = X.Lower(),
|
||||
IndexFin1 = MyPoles->Upper()-1,
|
||||
IndexFin2 = X.Upper() - MyWithAuxValue; // on decremente de 1 si le glissement
|
||||
// est libre car la derniere valeur de X lui est reserve.
|
||||
// calculs des poles contraints
|
||||
// for (ii=MyPoles->Lower();ii<=MyPoles->Upper();ii++) {
|
||||
// cout << ii << " X = " << MyPoles->Value(ii).X() <<
|
||||
IndexFin2 = X.Upper() - MyWithAuxValue; // decrease by 1 if the sliding is
|
||||
// is free as the last value of X is reserved.
|
||||
// calculation of pole constraints
|
||||
// for (ii=MyPoles->Lower();ii<=MyPoles->Upper();ii++) {
|
||||
// cout << ii << " X = " << MyPoles->Value(ii).X() <<
|
||||
// " Y = " << MyPoles->Value(ii).Y() << endl;}
|
||||
|
||||
if (MyContrOrder1 >= 1) {
|
||||
@@ -459,7 +459,7 @@ void FairCurve_Energy::ComputePoles(const math_Vector& X)
|
||||
}
|
||||
|
||||
// if (MyWithAuxValue) { MyLengthSliding = X(X.Upper()); }
|
||||
// recopie des autres
|
||||
// recopy others
|
||||
for (ii=IndexDeb1; ii<=IndexFin1; ii++) {
|
||||
MyPoles -> ChangeValue(ii).SetX( X(IndexDeb2) );
|
||||
MyPoles -> ChangeValue(ii).SetY( X(IndexDeb2+1) );
|
||||
|
@@ -44,15 +44,13 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(FairCurve_AnalysisCode& ACo
|
||||
//======================================================================================
|
||||
{
|
||||
Standard_Boolean Ok=Standard_True, End=Standard_False;
|
||||
Standard_Real AngleMax = 0.7; // parametre reglant la fonction d'increment
|
||||
// ( 40 degrees )
|
||||
Standard_Real AngleMin = 2*PI/100; // parametre reglant la fonction d'increment
|
||||
// un tour complet ne doit pas couter plus de
|
||||
// 100 pas.
|
||||
Standard_Real AngleMax = 0.7; // parameter regulating the function of increment ( 40 degrees )
|
||||
Standard_Real AngleMin = 2*PI/100; // parameter regulating the function of increment
|
||||
// full passage should not contain more than 100 steps.
|
||||
Standard_Real DAngle1, DAngle2, DRho1, DRho2, Ratio, Fraction, Toler;
|
||||
Standard_Real OldDist, NewDist;
|
||||
|
||||
// Boucle d'Homotopie : calcul du pas et optimisation
|
||||
// Loop of Homotopy : calculation of the step and optimisation
|
||||
|
||||
while (Ok && !End) {
|
||||
DAngle1 = NewAngle1-OldAngle1;
|
||||
@@ -133,7 +131,7 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& DeltaP1,
|
||||
Standard_Boolean Ok, OkCompute=Standard_True;
|
||||
ACode = FairCurve_OK;
|
||||
|
||||
// Deformation de la courbe par ajout d'un polynome d'interpolation
|
||||
// Deformation of the curve by adding a polynom of interpolation
|
||||
Standard_Integer L = 2 + NewConstraintOrder1 + NewConstraintOrder2,
|
||||
kk, ii;
|
||||
// NbP1 = Poles->Length()-1, kk, ii;
|
||||
@@ -152,24 +150,24 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& DeltaP1,
|
||||
TColgp_Array1OfPnt2d Interpolation(1,L);
|
||||
Handle(TColgp_HArray1OfPnt2d) NPoles = new TColgp_HArray1OfPnt2d(1, Poles->Length());
|
||||
|
||||
// Polynomes d'Hermites
|
||||
// Polynomes of Hermite
|
||||
math_Matrix HermiteCoef(1, L, 1, L);
|
||||
Ok = PLib::HermiteCoefficients(0,1, NewConstraintOrder1, NewConstraintOrder2,
|
||||
HermiteCoef);
|
||||
if (!Ok) return Standard_False;
|
||||
|
||||
// Definition des contraintes d'interpolation
|
||||
// Definition of constraints of interpolation
|
||||
TColgp_Array1OfXY ADelta(1,L);
|
||||
gp_Vec2d VOld(OldP1, OldP2), VNew( -(OldP1.XY()+DeltaP1.XY()) + (OldP2.XY()+DeltaP2.XY()) );
|
||||
Standard_Real DAngleRef = VNew.Angle(VOld);
|
||||
Standard_Real DAngle1 = DeltaAngle1 - DAngleRef,
|
||||
DAngle2 = DAngleRef - DeltaAngle2; // Correction du Delta par le Delta induit par les points.
|
||||
DAngle2 = DAngleRef - DeltaAngle2; // Correction of Delta by the Delta induced by the points.
|
||||
|
||||
|
||||
ADelta(1) = DeltaP1.XY();
|
||||
kk = 2;
|
||||
if (NewConstraintOrder1>0) {
|
||||
// rotation de la derive premiereDeltaAngle1
|
||||
// rotation of the derivative premiereDeltaAngle1
|
||||
gp_Vec2d OldDerive( Poles->Value(Poles->Lower()),
|
||||
Poles->Value(Poles->Lower()+1) );
|
||||
OldDerive *= Degree / (Knots->Value(Knots->Lower()+1)-Knots->Value(Knots->Lower()) );
|
||||
@@ -177,7 +175,7 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& DeltaP1,
|
||||
kk += 1;
|
||||
|
||||
if (NewConstraintOrder1>1) {
|
||||
// rotation de la derive seconde + ajout
|
||||
// rotation of the second derivative + adding
|
||||
gp_Vec2d OldSeconde( Poles->Value(Poles->Lower()).XY() + Poles->Value(Poles->Lower()+2).XY()
|
||||
- 2*Poles->Value(Poles->Lower()+1).XY() );
|
||||
OldSeconde *= Degree*( Degree-1)
|
||||
@@ -197,7 +195,7 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& DeltaP1,
|
||||
ADelta(kk) = (OldDerive.Rotated(DAngle2) - OldDerive).XY();
|
||||
kk += 1;
|
||||
if (NewConstraintOrder2>1) {
|
||||
// rotation de la derive seconde + ajout
|
||||
// rotation of the second derivative + adding
|
||||
gp_Vec2d OldSeconde( Poles->Value(Poles->Upper()).XY() + Poles->Value(Poles->Upper()-2).XY()
|
||||
- 2*Poles->Value(Poles->Upper()-1).XY() );
|
||||
OldSeconde *= Degree*( Degree-1)
|
||||
@@ -218,7 +216,7 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& DeltaP1,
|
||||
}
|
||||
Interpolation(ii).SetXY(AuxXY);
|
||||
}
|
||||
// Conversion en BSpline de meme structure que le batten courant.
|
||||
// Conversion into BSpline of the same structure as the current batten.
|
||||
PLib::CoefficientsPoles(Interpolation, PLib::NoWeights(),
|
||||
HermitePoles, PLib::NoWeights());
|
||||
|
||||
@@ -233,13 +231,13 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& DeltaP1,
|
||||
DeltaCurve->InsertKnots(Knots->Array1(), Mults->Array1(), 1.e-10);
|
||||
}
|
||||
|
||||
// Sommation
|
||||
// Summing
|
||||
DeltaCurve->Poles( NPoles->ChangeArray1() );
|
||||
for (kk= NPoles->Lower(); kk<=NPoles->Upper(); kk++) {
|
||||
NPoles->ChangeValue(kk).ChangeCoord() += Poles->Value(kk).Coord();
|
||||
}
|
||||
|
||||
// Donnees intermediaires
|
||||
// Intermediaires
|
||||
|
||||
Standard_Real Angle1, Angle2, SlidingLength,
|
||||
Alph1 = OldAngle1 + DeltaAngle1,
|
||||
@@ -253,12 +251,12 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& DeltaP1,
|
||||
P1P2 ( NPoles->Value(NPoles->Upper()).Coord()
|
||||
- NPoles->Value(NPoles->Lower()).Coord() );
|
||||
|
||||
// Angles par rapport a l'axe ox
|
||||
// Angles corresponding to axis ox
|
||||
|
||||
Angle1 = Ox.Angle(P1P2) + Alph1;
|
||||
Angle2 = -Ox.Angle(P1P2) + Alph2;
|
||||
|
||||
// Calcul de la longeur de glissement (impose ou intiale);
|
||||
// Calculation of the length of sliding (imposed or intial);
|
||||
|
||||
if (!NewFreeSliding) {
|
||||
SlidingLength = NewSlidingFactor * LReference;
|
||||
@@ -274,7 +272,7 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& DeltaP1,
|
||||
|
||||
|
||||
|
||||
// Energie et vecteurs d'initialisation
|
||||
// Energy and vectors of initialization
|
||||
FairCurve_BattenLaw LBatten (NewHeight, NewSlope, SlidingLength );
|
||||
FairCurve_EnergyOfMVC EMVC (Degree+1, Flatknots, NPoles,
|
||||
NewConstraintOrder1, NewConstraintOrder2,
|
||||
@@ -282,8 +280,7 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& DeltaP1,
|
||||
Angle1, Angle2, Rho1, Rho2);
|
||||
math_Vector VInit (1, EMVC.NbVariables());
|
||||
|
||||
// La valeur ci-dessous donne une idee de la plus petie valeur propre
|
||||
// du critere de flexion.
|
||||
// The value below gives an idea about the smallest value of the criterion of flexion.
|
||||
Standard_Real VConvex = 0.01 * pow(NewHeight / SlidingLength, 3);
|
||||
if (VConvex < 1.e-12) {VConvex = 1.e-12;}
|
||||
|
||||
@@ -358,17 +355,17 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& DeltaP1,
|
||||
|
||||
Ok = EMVC.Variable(VInit);
|
||||
|
||||
// Traitement de la non convergence
|
||||
// Processing of non convergence
|
||||
if (!Newton.IsConverged()) {
|
||||
ACode = FairCurve_NotConverged;
|
||||
}
|
||||
|
||||
|
||||
// Prevention du glissement infinie
|
||||
// Prevention of infinite sliding
|
||||
if (NewFreeSliding && VInit(VInit.Upper()) > 2*LReference) ACode = FairCurve_InfiniteSliding;
|
||||
|
||||
|
||||
// Insertion eventuelle de Noeuds
|
||||
// Eventual insertion of Nodes
|
||||
Standard_Boolean NewKnots = Standard_False;
|
||||
Standard_Integer NbKnots = Knots->Length();
|
||||
Standard_Real ValAngles = (Abs(OldAngle1) + Abs(OldAngle2)
|
||||
@@ -410,8 +407,7 @@ Standard_Boolean FairCurve_MinimalVariation::Compute(const gp_Vec2d& DeltaP1,
|
||||
}
|
||||
|
||||
|
||||
// Pour d'eventuelle debug
|
||||
// Newton.Dump(cout);
|
||||
// For eventual debug Newton.Dump(cout);
|
||||
|
||||
return OkCompute;
|
||||
}
|
||||
|
@@ -18,8 +18,8 @@ FairCurve_Newton::FairCurve_Newton(math_MultipleVarFunctionWithHessian& F,
|
||||
mySpTol(SpatialTolerance)
|
||||
|
||||
{
|
||||
// Attention cette ecriture est bancale car FairCurve_Newton::IsConverged() n'est pas
|
||||
// pas utiliser dans le constructeur de NewtonMinimum !!
|
||||
// Attention this writing is wrong as FairCurve_Newton::IsConverged() is not
|
||||
// used in the constructor of NewtonMinimum !!
|
||||
}
|
||||
|
||||
FairCurve_Newton::FairCurve_Newton(math_MultipleVarFunctionWithHessian& F,
|
||||
@@ -33,14 +33,14 @@ FairCurve_Newton::FairCurve_Newton(math_MultipleVarFunctionWithHessian& F,
|
||||
mySpTol(SpatialTolerance)
|
||||
|
||||
{
|
||||
// C'est beaucoup mieux
|
||||
// It is much better
|
||||
}
|
||||
|
||||
Standard_Boolean FairCurve_Newton::IsConverged() const
|
||||
// On converge si le pas est tres petits
|
||||
// ou si le critere progresse peu avec un pas raisonnable, cette derniere exigence
|
||||
// permetant de detecter les glissements infinis,
|
||||
// (cas ou le critere varie tres lentement).
|
||||
// Convert if the steps are too small
|
||||
// or if the criterion progresses little with a reasonable step, this last requirement
|
||||
// allows detecting infinite slidings,
|
||||
// (case when the criterion varies troo slowly).
|
||||
{
|
||||
Standard_Real N = TheStep.Norm();
|
||||
return ( (N <= mySpTol/100 ) ||
|
||||
|
Reference in New Issue
Block a user