previousd = myIntersectionOn2S.Direction();
previousd1 = myIntersectionOn2S.DirectionOnS1();
previousd2 = myIntersectionOn2S.DirectionOnS2();
- indextg = 1;
+ myTangentIdx = 1;
tgdir = previousd;
firstd1 = previousd1;
firstd2 = previousd2;
if(IsTangentExtCheck(Caro1, Caro2, Param(1), Param(2), Param(3), Param(4), myTolTang, pasuv))
return;
- AddAPoint(line,previousPoint);
+ AddAPoint(previousPoint);
//
IntWalk_StatusDeflection aStatus = IntWalk_OK, aPrevStatus = IntWalk_OK;
Standard_Boolean NoTestDeflection = Standard_False;
}
}
//
- AddAPoint(line,previousPoint);
+ AddAPoint(previousPoint);
RejectIndex++;
if(RejectIndex >= RejectIndexMAX)
if(close)
{
//================= la ligne est fermee ===============
- AddAPoint(line,line->Value(1)); //ligne fermee
+ AddAPoint(line->Value(1)); //ligne fermee
LevelOfIterWithoutAppend=0;
}
else //$$$
}
}
//
- AddAPoint(line,previousPoint);
+ AddAPoint(previousPoint);
RejectIndex++;
if(RejectIndex >= RejectIndexMAX)
}//if (previoustg) cond.
////////////////////////////////////////
- AddAPoint(line,previousPoint);
+ AddAPoint(previousPoint);
RejectIndex++;
if(RejectIndex >= RejectIndexMAX)
Standard_Integer i = 0;
for(i = 1; i <= aSeqOfNewPoint.Length(); i++) {
- AddAPoint(line, aSeqOfNewPoint.Value(i));
+ AddAPoint(aSeqOfNewPoint.Value(i));
}
return bOutOfTangentZone;
break;
}
- line->RemovePoint(1);
+ RemoveAPoint(1);
}
line->InsertBefore(1, anIP);
break;
}
- line->RemovePoint(aNbPnts);
+ RemoveAPoint(aNbPnts);
}
line->Add(anIP);
// Standard_Integer i;
if (Arrive) { //restart in the other direction
if (!DejaReparti ) {
- Arrive = Standard_False;
- DejaReparti = Standard_True;
+ Arrive = Standard_False;
+ DejaReparti = Standard_True;
previousPoint = line->Value(1);
- previoustg = Standard_False;
- previousd1 = firstd1;
- previousd2 = firstd2;
- previousd = tgdir;
- indextg = line->NbPoints();
+ previoustg = Standard_False;
+ previousd1 = firstd1;
+ previousd2 = firstd2;
+ previousd = tgdir;
+ myTangentIdx = line->NbPoints();
tgdir.Reverse();
line->Reverse();
tglast = Standard_True; // IS IT ENOUGH ????
}
- if (!DejaReparti) { //restart in the other direction
- DejaReparti = Standard_True;
- previousPoint = line->Value(1);
- previoustg = Standard_False;
- previousd1 = firstd1;
- previousd2 = firstd2;
- previousd = tgdir;
- indextg = line->NbPoints();
+ if (!DejaReparti)
+ { //restart in the other direction
+ DejaReparti = Standard_True;
+ previousPoint = line->Value(1);
+ previoustg = Standard_False;
+ previousd1 = firstd1;
+ previousd2 = firstd2;
+ previousd = tgdir;
+ myTangentIdx = line->NbPoints();
tgdir.Reverse();
line->Reverse();
Standard_EXPORT void RepartirOuDiviser (Standard_Boolean& DejaReparti, IntImp_ConstIsoparametric& ChoixIso, Standard_Boolean& Arrive);
- void AddAPoint (Handle(IntSurf_LineOn2S)& line, const IntSurf_PntOn2S& POn2S);
+ //! Inserts thePOn2S in the end of line
+ void AddAPoint (const IntSurf_PntOn2S& thePOn2S);
+
+ //! Removes point with index theIndex from line.
+ //! If theIndex is greater than the number of points in line
+ //! then the last point will be removed.
+ //! theIndex must be started with 1.
+ void RemoveAPoint(const Standard_Integer theIndex)
+ {
+ const Standard_Integer anIdx = Min(theIndex, line->NbPoints());
+
+ if (anIdx < 1)
+ return;
+
+ if (anIdx <= myTangentIdx)
+ {
+ myTangentIdx--;
+ }
+
+ line->RemovePoint(anIdx);
+ }
Standard_EXPORT Standard_Boolean PutToBoundary (const Handle(Adaptor3d_HSurface)& theASurf1, const Handle(Adaptor3d_HSurface)& theASurf2);
Standard_Boolean close;
Standard_Boolean tgfirst;
Standard_Boolean tglast;
- Standard_Integer indextg;
+ Standard_Integer myTangentIdx;
gp_Dir tgdir;
Standard_Real fleche;
Standard_Real pasMax;
return close;
}
-inline const gp_Dir& IntWalk_PWalking::TangentAtLine
- (Standard_Integer& Index) const
+inline const gp_Dir& IntWalk_PWalking::TangentAtLine(Standard_Integer& theIndex) const
{
if(!done) throw StdFail_NotDone();
- Index = indextg;
+ theIndex = myTangentIdx;
return tgdir;
}
#define REGLAGE 0
-inline void IntWalk_PWalking::AddAPoint(Handle(IntSurf_LineOn2S)& theLine,
- const IntSurf_PntOn2S& POn2S) {
+inline void IntWalk_PWalking::AddAPoint(const IntSurf_PntOn2S& POn2S) {
#if REGLAGE
Standard_Integer n=theLine->NbPoints();
if(n) {
fflush(stdout);
}
#endif
- theLine->Add(POn2S);
+ line->Add(POn2S);
+ myTangentIdx = Max(myTangentIdx, 1);
}
--- /dev/null
+puts "========"
+puts "OCC28764"
+puts "========"
+puts ""
+#################################################
+# [Regression to 7.0] Intersection of faces gives exception in debug mode
+#################################################
+
+restore [locate_data_file bug28764_ff.brep] f
+explode f
+
+####
+
+axo
+don f
+fit
+
+# Before the fix: Exception in Debug-mode only
+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
+