mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0027930: XMT file conversion loops infinitely
Now, the algorithm tries to estimate U- and V-ranges of future intersection curve(s) on the surface. This information is used in stop-criterium of the algorithm instead of full surface range used earlier. It allows reducing dependencies of intersection result on the surface ranges. Tuning of test case bugs/modalg_6/bug27937_1
This commit is contained in:
@@ -183,6 +183,9 @@ void IntWalk_IWalking::Perform(const ThePOPIterator& Pnts1,
|
||||
}
|
||||
|
||||
ThePointOfPathTool::Value2d(PathPnt, aWD1.ustart, aWD1.vstart);
|
||||
mySRangeU.Add(aWD1.ustart);
|
||||
mySRangeV.Add(aWD1.vstart);
|
||||
|
||||
wd1.push_back (aWD1);
|
||||
Standard_Integer aNbMult = ThePointOfPathTool::Multiplicity(PathPnt);
|
||||
nbMultiplicities.push_back(aNbMult);
|
||||
@@ -200,6 +203,9 @@ void IntWalk_IWalking::Perform(const ThePOPIterator& Pnts1,
|
||||
aWD2.etat = 1;
|
||||
const IntSurf_InteriorPoint& anIP = Pnts2.Value(I);
|
||||
ThePointOfLoopTool::Value2d(anIP, aWD2.ustart, aWD2.vstart);
|
||||
mySRangeU.Add(aWD2.ustart);
|
||||
mySRangeV.Add(aWD2.vstart);
|
||||
|
||||
if (!IsTangentExtCheck(Func, aWD2.ustart, aWD2.vstart, aStepU, aStepV, Um, UM, Vm, VM))
|
||||
aWD2.etat = 13;
|
||||
|
||||
@@ -211,6 +217,26 @@ void IntWalk_IWalking::Perform(const ThePOPIterator& Pnts1,
|
||||
|
||||
Func.Set(Caro);
|
||||
|
||||
if (mySRangeU.Delta() > Max(tolerance(1), Precision::PConfusion()))
|
||||
{
|
||||
mySRangeU.Enlarge(mySRangeU.Delta());
|
||||
mySRangeU.Common(Bnd_Range(Um, UM));
|
||||
}
|
||||
else
|
||||
{
|
||||
mySRangeU = Bnd_Range(Um, UM);
|
||||
}
|
||||
|
||||
if (mySRangeV.Delta() > Max(tolerance(2), Precision::PConfusion()))
|
||||
{
|
||||
mySRangeV.Enlarge(mySRangeV.Delta());
|
||||
mySRangeV.Common(Bnd_Range(Vm, VM));
|
||||
}
|
||||
else
|
||||
{
|
||||
mySRangeV = Bnd_Range(Vm, VM);
|
||||
}
|
||||
|
||||
// calculation of all open lines
|
||||
if (nbPnts1 != 0)
|
||||
ComputeOpenLine(Umult,Vmult,Pnts1,Func,Rajout);
|
||||
|
@@ -14,6 +14,7 @@
|
||||
|
||||
//-- IntWalk_IWalking_2.gxx
|
||||
|
||||
#include <Bnd_Range.hxx>
|
||||
#include <TColStd_MapOfInteger.hxx>
|
||||
|
||||
#ifndef OCCT_DEBUG
|
||||
@@ -389,11 +390,10 @@ Standard_Boolean IntWalk_IWalking::TestArretPassage
|
||||
Standard_Real UV2=UV(2);
|
||||
|
||||
|
||||
//-- Put everything in one box 0 1 x 0 1
|
||||
//-- actually it is necessary to carry out tests in 3D
|
||||
|
||||
Standard_Real deltau=UM-Um;
|
||||
Standard_Real deltav=VM-Vm;
|
||||
//Normalizing factor. If it is less than 1.0 then the range will be expanded.
|
||||
//This is no good for computation. Therefore, it is limited.
|
||||
const Standard_Real deltau = mySRangeU.IsVoid() ? UM - Um : Max(mySRangeU.Delta(), 1.0);
|
||||
const Standard_Real deltav = mySRangeV.IsVoid() ? VM - Vm : Max(mySRangeV.Delta(), 1.0);
|
||||
|
||||
Up/=deltau; UV1/=deltau;
|
||||
Vp/=deltav; UV2/=deltav;
|
||||
|
Reference in New Issue
Block a user