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

0023388: Boolean operations hang up trying to build section of two customer's shapes

This commit is contained in:
jgv 2012-09-20 14:33:48 +04:00
parent 185e6ec099
commit e9a6ce8256
4 changed files with 140 additions and 118 deletions

View File

@ -566,6 +566,31 @@ void IntPatch_WLine::ComputeVertexParameters(const Standard_Real RTol) {
} }
} }
//Remove duplicating points
if (Substitution)
{
Standard_Integer ind_point;
for(ind_point = 2; (ind_point <= nbponline && nbponline > 2); ind_point++) {
Standard_Real d = (curv->Value(ind_point-1).Value()).SquareDistance((curv->Value(ind_point).Value()));
if(d < dmini) {
curv->RemovePoint(ind_point);
nbponline--;
//----------------------------------------------
//-- On recadre les Vertex si besoin
//--
for(j=1; j<=nbvtx; j++) {
indicevertex = svtx.Value(j).ParameterOnLine();
if(indicevertex >= ind_point) {
svtx.ChangeValue(j).SetParameter(indicevertex-1.0);
}
}
//modified by NIZNHY-PKV Mon Feb 11 09:28:02 2002 f
ind_point--;
//modified by NIZNHY-PKV Mon Feb 11 09:28:04 2002 t
}
}
}
//--static int deb6nov98=1; Ne resout rien (a part partiellement BUC60409) //--static int deb6nov98=1; Ne resout rien (a part partiellement BUC60409)
//--if(deb6nov98) { //--if(deb6nov98) {
//--Substitution=Standard_True; //--Substitution=Standard_True;

View File

@ -45,47 +45,47 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
TheIWFunction& Func, TheIWFunction& Func,
Standard_Boolean& Rajout) Standard_Boolean& Rajout)
// traitement ligne ouvert. // Processing of open line.
// //
// 1) pour tout point de depart non passant et non tangent et non encore traite // 1) for any starting point, which is not passing and not tangent and not yet processed,
// calcul du pas d'avancement = pas en fonction de la fleche et du pas max. // calculation of the step of advancement = step depending on the arrow and the maximum step.
// //
// 2) calcul d'un point approche (ce point est sur la tangente a la section // 2) calculate a point of approach (this point is on the tangent to the section
// de distance = pas du point interieur) // of distance = no point in the interior)
// //
// 3) tant que { // 3) conditions {
// (l'ensemble des points calcules ne depassent pas un point dans la // (all calculated points do not exceed a point in the
// liste des points de depart) // list of starting points)
// ou // or
// (l'ensemble des points ne forme pas une ligne ouverte allant // (all points do not form an open line going
// d 'une frontiere du domaine a un autre ou d un point de tangence // from one border of the domain to the other or from a point tangent
// a une frontiere ou de 2 points de tangence : cas singuliers) // to border or from 2 tangent points : single cases)
// //
// 1) cadrage du point approche sur les frontieres si necessaire (il // 1) framing of approached point on borders if necessary (there is
// y a calcul du pas) // calculation of step)
// 2) calcul du point // 2) calculation of the point
// 3) si point non trouve on divise le pas // 3) if the point is not found the step is divided
// 4) tests d'arrets // 4) stpo tests
// 5) calcul du pas en fonction de la fleche et du pas maxi, // 5) calculation of the step depending on the arrow and the max step,
// (TestDeflection) // (TestDeflection)
// arret possible. // stop possible.
// fin tant que. // end of conditions.
{ {
Standard_Integer I, N; Standard_Integer I, N;
static math_Vector BornInf(1,2), BornSup(1,2), UVap(1,2); static math_Vector BornInf(1,2), BornSup(1,2), UVap(1,2);
Standard_Real PasC, PasCu, PasCv; Standard_Real PasC, PasCu, PasCv;
Standard_Boolean Arrive; // indique si ligne terminee Standard_Boolean Arrive; // shows if the line ends
Standard_Boolean Cadre; //indique si on est sur frontiere du domaine Standard_Boolean Cadre; // shows if one is on border of the domain
Standard_Boolean ArretAjout; //indique si on est sur point ajoute Standard_Boolean ArretAjout; //shows if one is on added point
IntSurf_PntOn2S Psol; IntSurf_PntOn2S Psol;
Handle(IntWalk_TheIWLine) CurrentLine; // ligne en construction Handle(IntWalk_TheIWLine) CurrentLine; // line under construction
Standard_Boolean Tgtend; Standard_Boolean Tgtend;
IntWalk_StatusDeflection Status, StatusPrecedent; IntWalk_StatusDeflection Status, StatusPrecedent;
Standard_Integer NbDivision; Standard_Integer NbDivision;
// nombre de fois que l on a divise le pas pour une section // number of divisions of step for each section
Standard_Integer StepSign; Standard_Integer StepSign;
@ -107,7 +107,7 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
// modified by NIZHNY-MKK Fri Oct 27 12:32:38 2000.END // modified by NIZHNY-MKK Fri Oct 27 12:32:38 2000.END
for (I = 1; I <= nbPath; I++) { for (I = 1; I <= nbPath; I++) {
//point de depart de cheminement //start point of the progression
// if (etat1(I) > 11) { // if (etat1(I) > 11) {
// modified by NIZHNY-MKK Fri Oct 27 12:33:37 2000.BEGIN // modified by NIZHNY-MKK Fri Oct 27 12:33:37 2000.BEGIN
if ((etat1(I) > 11) || ((etat1(I) < -11) && (movementdirectioninfo(I)!=0))) { if ((etat1(I) > 11) || ((etat1(I) < -11) && (movementdirectioninfo(I)!=0))) {
@ -149,7 +149,7 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
etat1(I) = - abs(etat1(I)); etat1(I) = - abs(etat1(I));
movementdirectioninfo(I) = (movementdirectioninfo(I)==0) ? StepSign : 0; movementdirectioninfo(I) = (movementdirectioninfo(I)==0) ? StepSign : 0;
// Modified by Sergey KHROMOV - Tue Nov 20 10:41:56 2001 End // Modified by Sergey KHROMOV - Tue Nov 20 10:41:56 2001 End
// premier pas d avancement // first step of advancement
Standard_Real d2dx = Abs(previousd2d.X()); Standard_Real d2dx = Abs(previousd2d.X());
Standard_Real d2dy = Abs(previousd2d.Y()); Standard_Real d2dy = Abs(previousd2d.Y());
if (d2dx < tolerance(1)) { if (d2dx < tolerance(1)) {
@ -169,10 +169,10 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
// modified by NIZHNY-MKK Fri Oct 27 12:39:37 2000 // modified by NIZHNY-MKK Fri Oct 27 12:39:37 2000
Standard_Integer IndexOfPathPointDoNotCheck=0; Standard_Integer IndexOfPathPointDoNotCheck=0;
while (!Arrive) { // tant que un des tests d arret est non verifie while (!Arrive) { // as one of stop tests is not checked
Cadre = Cadrage(BornInf,BornSup,UVap,PasC,StepSign); Cadre = Cadrage(BornInf,BornSup,UVap,PasC,StepSign);
// Frontiere? // Border?
#ifdef CHRONO #ifdef CHRONO
Chronrsnld.Start(); Chronrsnld.Start();
@ -196,17 +196,17 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
if (CurrentLine->NbPoints() == 1) break; if (CurrentLine->NbPoints() == 1) break;
Arrive = Standard_True; Arrive = Standard_True;
CurrentLine->AddStatusLast(Standard_False); CurrentLine->AddStatusLast(Standard_False);
Tgtend = Standard_True; // a voir Tgtend = Standard_True; // check
Rajout = Standard_True; Rajout = Standard_True;
seqAjout.Append(lines.Length() + 1); seqAjout.Append(lines.Length() + 1);
} }
} }
else { // test arret else { // test stop
Rsnld.Root(UVap); Rsnld.Root(UVap);
Arrive = TestArretPassage(Umult, Vmult, Func, UVap, N); Arrive = TestArretPassage(Umult, Vmult, Func, UVap, N);
if (Arrive) { if (Arrive) {
Cadre = Standard_False; Cadre = Standard_False;
//au cas ou on aurait cadre et arrive en meme temps //in case if there is a frame and arrive at the same time
} }
else { else {
if (Rajout) { if (Rajout) {
@ -234,7 +234,7 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
} }
// modified by NIZHNY-MKK Thu Nov 2 15:09:13 2000.END // modified by NIZHNY-MKK Thu Nov 2 15:09:13 2000.END
if (!ArretAjout && Cadre) { if (!ArretAjout && Cadre) {
if (CurrentLine->NbPoints() == 1) break; // annuler la ligne if (CurrentLine->NbPoints() == 1) break; // cancel the line
TestArretCadre(Umult, Vmult, CurrentLine, Func, UVap, N); TestArretCadre(Umult, Vmult, CurrentLine, Func, UVap, N);
// if (N == 0) { // if (N == 0) {
if (N <= 0) { // jag 941017 if (N <= 0) { // jag 941017
@ -270,7 +270,7 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
} }
} }
else if (Status == IntWalk_ArretSurPointPrecedent) { else if (Status == IntWalk_ArretSurPointPrecedent) {
if (CurrentLine->NbPoints() == 1) { //annuler la ligne if (CurrentLine->NbPoints() == 1) { //cancel the line
Arrive = Standard_False; Arrive = Standard_False;
break; break;
} }
@ -278,37 +278,36 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
Rajout = Standard_True; Rajout = Standard_True;
seqAjout.Append(lines.Length() + 1); seqAjout.Append(lines.Length() + 1);
CurrentLine->AddStatusLast(Standard_False); CurrentLine->AddStatusLast(Standard_False);
Tgtend = Standard_True; // a voir Tgtend = Standard_True; // check
} }
else if (Arrive) { else if (Arrive) {
if (CurrentLine->NbPoints() == 1 && // annuler la ligne if (CurrentLine->NbPoints() == 1 && // cancel the line
(N == I || Status == IntWalk_PointConfondu) ) { (N == I || Status == IntWalk_PointConfondu) ) {
// si N == I on s est probablement trompe de uv // if N == I the main uv is probably lost
// principal ou bien le point // or the point is a point of accumulation
// est un point d accumulation // if point is confused the start data is bad
// si point confondu les donnees de depart sont mauvaises
Arrive = Standard_False; Arrive = Standard_False;
break; break;
} }
// on a necessairement N > 0 jag 940617 // necessairily N > 0 jag 940617
// point d arret donne en entree // point of stop given at input
PathPnt = Pnts1.Value(N); PathPnt = Pnts1.Value(N);
Standard_Integer etat1N=etat1(N); Standard_Integer etat1N=etat1(N);
// modified by NIZHNY-MKK Thu Nov 2 15:09:51 2000.BEGIN // modified by NIZHNY-MKK Thu Nov 2 15:09:51 2000.BEGIN
// if (etat1N < 11) { // point passant qui est un arret // if (etat1N < 11) { // passing point that is a stop
if (Abs(etat1N) < 11) { // point passant qui est un arret if (Abs(etat1N) < 11) { // passing point that is a stop
// modified by NIZHNY-MKK Thu Nov 2 15:12:11 2000.END // modified by NIZHNY-MKK Thu Nov 2 15:12:11 2000.END
if (Status == IntWalk_ArretSurPoint) { if (Status == IntWalk_ArretSurPoint) {
CurrentLine->AddStatusLast(Standard_False); CurrentLine->AddStatusLast(Standard_False);
Tgtend = Standard_True; // a voir Tgtend = Standard_True; // need check
} }
else { else {
Arrive = Standard_False; Arrive = Standard_False;
} }
CurrentLine->AddIndexPassing(N); CurrentLine->AddIndexPassing(N);
} }
else { // point d arret donne en entree else { // point of stop given at input
if (etat1N == 11) { if (etat1N == 11) {
Tgtend = Standard_True; Tgtend = Standard_True;
} }
@ -348,7 +347,7 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
} }
} }
} }
else { // pas de solution numerique else { // no numerical solution
PasC = PasC / 2.; PasC = PasC / 2.;
PasCu = Abs(PasC*previousd2d.X()); PasCu = Abs(PasC*previousd2d.X());
PasCv = Abs(PasC*previousd2d.Y()); PasCv = Abs(PasC*previousd2d.Y());
@ -356,12 +355,12 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
if (CurrentLine->NbPoints()==1) break; if (CurrentLine->NbPoints()==1) break;
Arrive = Standard_True; Arrive = Standard_True;
CurrentLine->AddStatusLast(Standard_False); CurrentLine->AddStatusLast(Standard_False);
Tgtend = Standard_True; // a voir Tgtend = Standard_True; // need check
Rajout = Standard_True; Rajout = Standard_True;
seqAjout.Append(lines.Length() + 1); seqAjout.Append(lines.Length() + 1);
} }
} }
} // fin de la ligne commencee } // end of started line
if (Arrive) { if (Arrive) {
CurrentLine->SetTangencyAtEnd(Tgtend); CurrentLine->SetTangencyAtEnd(Tgtend);
@ -438,8 +437,8 @@ void IntWalk_IWalking::ComputeOpenLine(const TColStd_SequenceOfReal& Umult,
} }
} }
} //fin de traitement d un point } //end of point processing
} //fin de tous les points } //end of all points
} }
// modified by NIZHNY-MKK Thu Nov 2 15:07:53 2000.BEGIN // modified by NIZHNY-MKK Thu Nov 2 15:07:53 2000.BEGIN
@ -463,7 +462,7 @@ static Standard_Boolean TestPassedSolutionWithNegativeState(const TColStd_Sequen
for (i = 1; i <= etat.Length(); i++) { for (i = 1; i <= etat.Length(); i++) {
if (etat(i) < -11) { if (etat(i) < -11) {
// debug jag voir avec isg // debug jag see with isg
Utest = ustart(i); Utest = ustart(i);
Vtest = vstart(i); Vtest = vstart(i);

View File

@ -29,41 +29,40 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
const ThePOLIterator& Pnts2, const ThePOLIterator& Pnts2,
TheIWFunction& Func, TheIWFunction& Func,
Standard_Boolean& Rajout ) Standard_Boolean& Rajout )
// *********** traitement ligne fermee ********************** // *********** Processing of closed line **********************
// //
// pour tout point interieur non encore traite // for any interior non-processed point
// calculer le pas d avancement=pas en fonction de la fleche // calculate the step of advancement=step depending on the arrow and max step
// et du pas max // calculate a point of approach (this point is on the tangent to the section
// calculer un point approche (ce point est sur la tangente a la section // of distance = no interior point)
// de distance = pas du point interieur) // conditions
// tant que // (all calculated points do not form a closed loop)
// (l ensemble des points calcules ne forme pas une boucle fermee) // or
// ou // (all points do not form an open line going from
// (l ensemble des points ne forme pas une ligne ouverte allant // one border of the domain to the other or from a point tangent
// d une frontiere du domaine a un autre ou d un point de tangence // to the border or from 2 tangent points : single cases)
// a une frontiere ou de 2 points de tangence :cas singuliers)
// //
// cadrer le point approche sur les frontieres si necessaire // frame the point of approach on borders if necessary
// calcul du point // calculate the point
// si point non trouve diviser le pas // if point not found divide the step
// test d arret // test of stop
// calcul du pas en fonction de la fleche et du pas maxi(arret possible) // calculate step depending on the arrow and the max step (stop possible)
// //
// ******************************************************************** // ********************************************************************
{ {
Standard_Integer I,N; Standard_Integer I,N;
static math_Vector BornInf(1,2),BornSup(1,2); static math_Vector BornInf(1,2),BornSup(1,2);
static math_Vector Uvap(1,2);// parametres approches courant static math_Vector Uvap(1,2);// parameters of current approach
Standard_Real PasC; // taux d`avancement sur la tangente Standard_Real PasC; // rate of advancement on the tangent
Standard_Real PasCu; // pas d avancement courant en U Standard_Real PasCu; // rate of advancement current by U
Standard_Real PasCv; // pas d avancement courant en V Standard_Real PasCv; // step of advancement current by V
Standard_Real PasSav; //sauvegarde du premier pas d avancement Standard_Real PasSav; // save first step of advancement
Standard_Boolean Arrive;// indique si ligne terminee Standard_Boolean Arrive;// show if line ends
Standard_Boolean Cadre; //indique si on est sur frontiere du domaine Standard_Boolean Cadre; // show if on border of the domains
Standard_Boolean ArretAjout; //indique si on est sur un point ajoute Standard_Boolean ArretAjout; // show if on the added point
IntSurf_PntOn2S Psol; IntSurf_PntOn2S Psol;
Handle(IntWalk_TheIWLine) CurrentLine; //ligne en construction Handle(IntWalk_TheIWLine) CurrentLine; //line under construction
ThePointOfPath PathPnt; ThePointOfPath PathPnt;
ThePointOfLoop LoopPnt; ThePointOfLoop LoopPnt;
@ -72,12 +71,11 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
Standard_Integer StepSign; Standard_Integer StepSign;
IntWalk_StatusDeflection Status,StatusPrecedent; IntWalk_StatusDeflection Status,StatusPrecedent;
Standard_Integer NbDivision ; // nombre de fois que l on a divise le pas Standard_Integer NbDivision ; // number of divisions of step
// lors du calcul d 1 section // during calculation of 1 section
Standard_Integer Ipass ; Standard_Integer Ipass ;
//indice dans l iterateur des points sur arete du point de //index in the iterator of points on edge of point of passage
//passage
BornInf(1) = Um; BornInf(1) = Um;
@ -89,7 +87,7 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
Standard_Integer nbLoop = Pnts2.Length(); Standard_Integer nbLoop = Pnts2.Length();
for (I = 1;I<=nbLoop;I++) { for (I = 1;I<=nbLoop;I++) {
if (etat2(I) > 12) { // point de demarrage de ligne fermee if (etat2(I) > 12) { // start point of closed line
LoopPnt = Pnts2.Value(I); LoopPnt = Pnts2.Value(I);
previousPoint.SetValue(ThePointOfLoopTool::Value3d(LoopPnt),reversed, previousPoint.SetValue(ThePointOfLoopTool::Value3d(LoopPnt),reversed,
@ -107,7 +105,7 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
StepSign = 1; StepSign = 1;
// premier pas d avancement // first step of advancement
Standard_Real d2dx = Abs(previousd2d.X()); Standard_Real d2dx = Abs(previousd2d.X());
Standard_Real d2dy = Abs(previousd2d.Y()); Standard_Real d2dy = Abs(previousd2d.Y());
@ -127,8 +125,8 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
ArretAjout = Standard_False; ArretAjout = Standard_False;
NbDivision = 0; NbDivision = 0;
StatusPrecedent = IntWalk_OK; StatusPrecedent = IntWalk_OK;
while (!Arrive) { // tant que aucun test d arret verifie while (!Arrive) { // as no test of stop is passed
Cadre=Cadrage(BornInf,BornSup,Uvap,PasC, StepSign); // frontiere? Cadre=Cadrage(BornInf,BornSup,Uvap,PasC, StepSign); // border?
#ifdef CHRONO #ifdef CHRONO
Chronrsnld.Start(); Chronrsnld.Start();
#endif #endif
@ -139,11 +137,11 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
Chronrsnld.Stop(); Chronrsnld.Stop();
#endif #endif
if (Cadre) { // remise a jour des bornes. if (Cadre) { // update of limits.
BornInf(1) = Um;BornSup(1) = UM;BornInf(2) = Vm;BornSup(2) = VM; BornInf(1) = Um;BornSup(1) = UM;BornInf(2) = Vm;BornSup(2) = VM;
} }
if (Rsnld.IsDone()) { if (Rsnld.IsDone()) {
if (Abs(Func.Root()) > Func.Tolerance()) { // pas de solution a la tolerance if (Abs(Func.Root()) > Func.Tolerance()) { // no solution for the tolerance
PasC = PasC/2.; PasC = PasC/2.;
PasCu = Abs(PasC*previousd2d.X()); PasCu = Abs(PasC*previousd2d.X());
PasCv = Abs(PasC*previousd2d.Y()); PasCv = Abs(PasC*previousd2d.Y());
@ -158,10 +156,10 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
Tgtend = Standard_True; Tgtend = Standard_True;
} }
} }
else { // il y a une solution else { // there is a solution
Rsnld.Root(Uvap); Rsnld.Root(Uvap);
Arrive = TestArretPassage(Umult,Vmult,Uvap,I,Ipass); Arrive = TestArretPassage(Umult,Vmult,Uvap,I,Ipass);
if (Arrive) {//remettre les bons parametres pour le test de fleche. if (Arrive) {//reset proper parameter to test the arrow.
Psol = CurrentLine->Value(1); Psol = CurrentLine->Value(1);
if (!reversed) { if (!reversed) {
Psol.ParametersOnS2(Uvap(1),Uvap(2)); Psol.ParametersOnS2(Uvap(1),Uvap(2));
@ -170,11 +168,11 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
Psol.ParametersOnS1(Uvap(1),Uvap(2)); Psol.ParametersOnS1(Uvap(1),Uvap(2));
} }
Cadre=Standard_False; Cadre=Standard_False;
//au cas ou on aurait cadre et arrive en meme temps //in case if there is a frame and arrival at the same time
} }
else { // modif jag 940615 else { // modif jag 940615
if (Rajout) { // test sur les points rajoutes if (Rajout) { // test on added points
ArretAjout =TestArretAjout(Func,Uvap,N,Psol); ArretAjout =TestArretAjout(Func,Uvap,N,Psol);
if (ArretAjout) { if (ArretAjout) {
if (N >0) { if (N >0) {
@ -188,8 +186,8 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
} }
} }
if (!ArretAjout&& Cadre) { // test sur les points deja marques if (!ArretAjout&& Cadre) { // test on already marked points
if (CurrentLine->NbPoints() == 1) break; // annuler la ligne if (CurrentLine->NbPoints() == 1) break; // cancel the line
TestArretCadre(Umult,Vmult,CurrentLine,Func,Uvap,N); TestArretCadre(Umult,Vmult,CurrentLine,Func,Uvap,N);
// if (N==0) { // if (N==0) {
if (N <= 0) { // jag 941017 if (N <= 0) { // jag 941017
@ -197,13 +195,13 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
Tgtend = Func.IsTangent(); // jag 940616 Tgtend = Func.IsTangent(); // jag 940616
N = -N; N = -N;
} }
Arrive = (etat2(I) == 12); // la ligne s est ouverte Arrive = (etat2(I) == 12); // the line is open
} }
} }
Status = TestDeflection(Func, Arrive,Uvap,StatusPrecedent, Status = TestDeflection(Func, Arrive,Uvap,StatusPrecedent,
NbDivision,PasC,StepSign); NbDivision,PasC,StepSign);
StatusPrecedent = Status; StatusPrecedent = Status;
if (Status == IntWalk_PasTropGrand) {// division du pas if (Status == IntWalk_PasTropGrand) {// division of the step
Arrive = Standard_False; Arrive = Standard_False;
ArretAjout = Standard_False; ArretAjout = Standard_False;
Tgtend = Standard_False; // jag 940616 Tgtend = Standard_False; // jag 940616
@ -216,7 +214,7 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
} }
else if (ArretAjout || Cadre) { else if (ArretAjout || Cadre) {
if (Arrive) { // la ligne s est ouverte if (Arrive) { // line s is open
CurrentLine->AddStatusLast(Standard_False); CurrentLine->AddStatusLast(Standard_False);
if (Status != IntWalk_ArretSurPointPrecedent) { if (Status != IntWalk_ArretSurPointPrecedent) {
CurrentLine->AddPoint(Psol); CurrentLine->AddPoint(Psol);
@ -227,8 +225,8 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
} }
} }
else { // a ouvrir else { // open
etat2(I) = 12; //la declarer ouverte etat2(I) = 12; // declare it open
Tgtbeg = Tgtend; Tgtbeg = Tgtend;
Tgtend = Standard_False; Tgtend = Standard_False;
ArretAjout = Standard_False; ArretAjout = Standard_False;
@ -249,12 +247,12 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
} }
else if ( Status == IntWalk_ArretSurPointPrecedent) { else if ( Status == IntWalk_ArretSurPointPrecedent) {
if (CurrentLine->NbPoints() == 1) { //annuler la ligne if (CurrentLine->NbPoints() == 1) { //cancel the line
Arrive = Standard_False; Arrive = Standard_False;
break; break;
} }
if (etat2(I) >12) { //la ligne doit s ouvrir if (etat2(I) >12) { //the line should become open
etat2(I) = 12; //la declarer ouverte etat2(I) = 12; //declare it open
ArretAjout = Standard_False; ArretAjout = Standard_False;
OpenLine(0,Psol,Pnts1,Func,CurrentLine); OpenLine(0,Psol,Pnts1,Func,CurrentLine);
StepSign = -1; StepSign = -1;
@ -264,7 +262,7 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
Rajout = Standard_True; Rajout = Standard_True;
seqAjout.Append(-lines.Length()-1); seqAjout.Append(-lines.Length()-1);
} }
else { // la ligne s est ouverte else { // line s is open
Arrive =Standard_True; Arrive =Standard_True;
CurrentLine->AddStatusLast(Standard_False); CurrentLine->AddStatusLast(Standard_False);
Rajout = Standard_True; Rajout = Standard_True;
@ -272,20 +270,20 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
} }
} }
else if (Arrive) { else if (Arrive) {
if (etat2(I) > 12) { //ligne fermee bon cas if (etat2(I) > 12) { //line closed good case
CurrentLine->AddStatusFirstLast(Standard_True, CurrentLine->AddStatusFirstLast(Standard_True,
Standard_False,Standard_False); Standard_False,Standard_False);
CurrentLine->AddPoint(CurrentLine->Value(1)); CurrentLine->AddPoint(CurrentLine->Value(1));
} }
else if (N >0) { //point d arret donne en entree else if (N >0) { //point of stop given at input
PathPnt = Pnts1.Value(N); PathPnt = Pnts1.Value(N);
CurrentLine->AddStatusLast(Standard_True,N,PathPnt); CurrentLine->AddStatusLast(Standard_True,N,PathPnt);
AddPointInCurrentLine(N,PathPnt,CurrentLine); AddPointInCurrentLine(N,PathPnt,CurrentLine);
} }
} }
else if (Status == IntWalk_ArretSurPoint) { else if (Status == IntWalk_ArretSurPoint) {
if (etat2(I) >12) { //la ligne doit s ouvrir if (etat2(I) >12) { //line should become open
etat2(I) = 12; //la declarer ouverte etat2(I) = 12; //declare it open
Tgtbeg = Standard_True; Tgtbeg = Standard_True;
Tgtend = Standard_False; Tgtend = Standard_False;
N= -lines.Length()-1; N= -lines.Length()-1;
@ -300,7 +298,7 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
} }
else { else {
Arrive = Standard_True; Arrive = Standard_True;
if (Ipass!=0) { //point de passage ,point d arret if (Ipass!=0) { //point of passage, point of stop
PathPnt = Pnts1.Value(Ipass); PathPnt = Pnts1.Value(Ipass);
CurrentLine->AddStatusLast(Standard_True,Ipass,PathPnt); CurrentLine->AddStatusLast(Standard_True,Ipass,PathPnt);
AddPointInCurrentLine(Ipass,PathPnt,CurrentLine); AddPointInCurrentLine(Ipass,PathPnt,CurrentLine);
@ -324,13 +322,13 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
} }
} }
} }
else { //pas de solution numerique NotDone else { //no numerical solution NotDone
PasC = PasC/2.; PasC = PasC/2.;
PasCu = Abs(PasC*previousd2d.X()); PasCu = Abs(PasC*previousd2d.X());
PasCv = Abs(PasC*previousd2d.Y()); PasCv = Abs(PasC*previousd2d.Y());
if (PasCu <= tolerance(1) && PasCv <= tolerance(2)) { if (PasCu <= tolerance(1) && PasCv <= tolerance(2)) {
if (CurrentLine->NbPoints() == 1) break; // annuler la ligne if (CurrentLine->NbPoints() == 1) break; // cancel the line
Arrive = Standard_True; Arrive = Standard_True;
CurrentLine->AddStatusFirstLast(Standard_False,Standard_False, CurrentLine->AddStatusFirstLast(Standard_False,Standard_False,
Standard_False); Standard_False);
@ -339,16 +337,16 @@ void IntWalk_IWalking::ComputeCloseLine(const TColStd_SequenceOfReal& Umult,
seqAjout.Append(lines.Length()+1); seqAjout.Append(lines.Length()+1);
} }
} }
}// fin de la ligne commencee }// end of started line
if (Arrive) { if (Arrive) {
CurrentLine->SetTangencyAtBegining(Tgtbeg); CurrentLine->SetTangencyAtBegining(Tgtbeg);
CurrentLine->SetTangencyAtEnd(Tgtend); CurrentLine->SetTangencyAtEnd(Tgtend);
lines.Append(CurrentLine); lines.Append(CurrentLine);
etat2(I)=-etat2(I); //marque le point comme traite etat2(I)=-etat2(I); //mark point as processed
} }
} //fin de traitement d un point de depart } //end of processing of start point
} //fin de tous les points de depart } //end of all start points
} }

View File

@ -144,7 +144,7 @@ IntWalk_PWalking::IntWalk_PWalking(const ThePSurface& Caro1,
if(ThePSurfaceTool::IsUPeriodic(Caro1)==Standard_False) { if(ThePSurfaceTool::IsUPeriodic(Caro1)==Standard_False) {
UM1+=KELARG*pasuv[0]; Um1-=KELARG*pasuv[0]; //UM1+=KELARG*pasuv[0]; Um1-=KELARG*pasuv[0];
} }
else { else {
Standard_Real t = UM1-Um1; Standard_Real t = UM1-Um1;
@ -156,7 +156,7 @@ IntWalk_PWalking::IntWalk_PWalking(const ThePSurface& Caro1,
} }
if(ThePSurfaceTool::IsVPeriodic(Caro1)==Standard_False) { if(ThePSurfaceTool::IsVPeriodic(Caro1)==Standard_False) {
VM1+=KELARG*pasuv[1]; Vm1-=KELARG*pasuv[1]; //VM1+=KELARG*pasuv[1]; Vm1-=KELARG*pasuv[1];
} }
else { else {
Standard_Real t = VM1-Vm1; Standard_Real t = VM1-Vm1;
@ -168,7 +168,7 @@ IntWalk_PWalking::IntWalk_PWalking(const ThePSurface& Caro1,
} }
if(ThePSurfaceTool::IsUPeriodic(Caro2)==Standard_False) { if(ThePSurfaceTool::IsUPeriodic(Caro2)==Standard_False) {
UM2+=KELARG*pasuv[2]; Um2-=KELARG*pasuv[2]; //UM2+=KELARG*pasuv[2]; Um2-=KELARG*pasuv[2];
} }
else { else {
Standard_Real t = UM2-Um2; Standard_Real t = UM2-Um2;
@ -180,7 +180,7 @@ IntWalk_PWalking::IntWalk_PWalking(const ThePSurface& Caro1,
} }
if(ThePSurfaceTool::IsVPeriodic(Caro2)==Standard_False) { if(ThePSurfaceTool::IsVPeriodic(Caro2)==Standard_False) {
VM2+=KELARG*pasuv[3]; Vm2-=KELARG*pasuv[3]; //VM2+=KELARG*pasuv[3]; Vm2-=KELARG*pasuv[3];
} }
else { else {
Standard_Real t = VM2-Vm2; Standard_Real t = VM2-Vm2;