1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0027341: Incorrect exact HLR results

- removal of excess interferences in case of simple hiding face
- correct processing of boundary edges coinciding with outlines
- change of API for testing Draw Command
- correction of Draw command "build3d"
- test cases are added.

Linux reference data is changed.

Partially fixed 0027340: Insufficient exact HLR speed

Number of samples in PolyPoly intersection algorithm tuned in each instance of generic class.
Default number of the samples in Geom2dAdaptor is changed according to the Adaptor2d_Curve2d class.
Minimal number of points in case of B-Spline is changed.
Minimal number of samples support is added in intersection algorithms.
This commit is contained in:
aml
2016-05-25 12:19:24 +03:00
committed by bugmaster
parent 41e08b4df8
commit 5ae6e53dec
61 changed files with 1493 additions and 136 deletions

View File

@@ -1116,57 +1116,20 @@ IntCurve_IntCurveCurveGen::InternalCompositePerform(const TheCurve& C1,
}
}
//=======================================================================
//function : SetMinNbSamples
//purpose :
//=======================================================================
void IntCurve_IntCurveCurveGen::SetMinNbSamples(const Standard_Integer theMinNbSamples)
{
intcurvcurv.SetMinNbSamples(theMinNbSamples);
}
//----------------------------------------------------------------------
//-- InterComposite ( C1 , Num1 , C2 , Num2 , Recursion_sur_C2 )
//--
//-- Boolean Arret = False
//--
//-- Si C2.Type() == Composite Max2 = C2.GetIntervals() Sinon Max2=2
//--
//-- Si C1.Type() == Composite Max1 = C1.GetIntervals() Sinon Max1=2
//--
//-- Si Num2 > Max2 RETURN;
//--
//-- Sinon
//--
//-- Si Recursion_sur_C2 == True
//--
//-- for i = Num1 --> Max1
//--
//-- Num1 = i
//--
//-- InterComposite(C2,Num2,C1,Num1,False);
//--
//-- Si Num2 < Max2
//--
//-- Num2++
//--
//-- Num1 = 1
//--
//-- InterComposite(C1,Num1,C2,Num2,True);
//--
//-- Sinon
//--
//-- *** INTERSECTION ENTRE C2[num2] et C1[Num1] ***
//--
//-- Fin
//--
//--
//-- (( Appel avec C1 , 1 , C2 , 1 , True))
//--
//-- Exemple : C1 = ABCD C2= 12
//--
//-- donne : A,1 B,1 C,1 D,1 A,2 B,2 C,2 D,2
//----------------------------------------------------------------------
//=======================================================================
//function : GetMinNbSamples
//purpose :
//=======================================================================
Standard_Integer IntCurve_IntCurveCurveGen::GetMinNbSamples() const
{
return intcurvcurv.GetMinNbSamples();
}

View File

@@ -50,10 +50,7 @@
//======================================================================
// Modified by skv - Tue Mar 1 14:22:09 2005 OCC8169 Begin
// #define NBITER_MAX_POLYGON 3
#define NBITER_MAX_POLYGON 10
// Modified by skv - Tue Mar 1 14:22:09 2005 OCC8169 End
#define TOL_CONF_MINI 0.0000000001
#define TOL_MINI 0.0000000001
@@ -84,7 +81,10 @@ Standard_Boolean HeadOrEndPoint( const IntRes2d_Domain& D1
//======================================================================
IntCurve_IntPolyPolyGen::IntCurve_IntPolyPolyGen(void) {
IntCurve_IntPolyPolyGen::IntCurve_IntPolyPolyGen()
{
const Standard_Integer aMinPntNb = 20; // Minimum number of samples.
myMinPntNb = aMinPntNb;
done = Standard_False;
}
//======================================================================
@@ -631,50 +631,43 @@ Standard_Boolean HeadOrEndPoint( const IntRes2d_Domain& D1
return(Standard_False);
}
//======================================================================
void IntCurve_IntPolyPolyGen::Perform( const TheCurve& C1
,const IntRes2d_Domain& D1
,const TheCurve& C2
,const IntRes2d_Domain& D2
,const Standard_Real TolConf
,const Standard_Real Tol
,const Standard_Integer NbIter
,const Standard_Real DeltaU
,const Standard_Real DeltaV) {
//=======================================================================
//function : Perform
//purpose : Base method to perform polyline / polyline intersection for
// pair of curves.
//=======================================================================
void IntCurve_IntPolyPolyGen::Perform(const TheCurve& C1,
const IntRes2d_Domain& D1,
const TheCurve& C2,
const IntRes2d_Domain& D2,
const Standard_Real TolConf,
const Standard_Real Tol,
const Standard_Integer NbIter,
const Standard_Real DeltaU,
const Standard_Real DeltaV)
{
Standard_Integer nbsamplesOnC1,nbsamplesOnC2;
done = Standard_False;
if(NbIter>NBITER_MAX_POLYGON) return;
nbsamplesOnC1 = TheCurveTool::NbSamples(C1,D1.FirstParameter(),D1.LastParameter());
if (NbIter == 0) // first time
{
if (nbsamplesOnC1 < 20)
nbsamplesOnC1 = 20;
}
else // NbIter > 0
{
nbsamplesOnC1=(5*(nbsamplesOnC1*NbIter))/4;
}
/////////////////////////////////////////////
// Number of samples tunning.
nbsamplesOnC1 = TheCurveTool::NbSamples(C1,D1.FirstParameter(),D1.LastParameter());
nbsamplesOnC2 = TheCurveTool::NbSamples(C2,D2.FirstParameter(),D2.LastParameter());
if (NbIter == 0) // first time
{
if (nbsamplesOnC2 < 20)
nbsamplesOnC2 = 20;
}
else // NbIter > 0
{
nbsamplesOnC2=(5*(nbsamplesOnC2*NbIter))/4;
}
/////////////////////////////////////////////
if (NbIter == 0)
{
// Minimal number of points.
nbsamplesOnC1 = Max(nbsamplesOnC1, myMinPntNb);
nbsamplesOnC2 = Max(nbsamplesOnC2, myMinPntNb);
}
else
{
// Increase number of samples in second and next iterations.
nbsamplesOnC1=(5 * (nbsamplesOnC1 * NbIter)) / 4;
nbsamplesOnC2=(5 * (nbsamplesOnC2 * NbIter)) / 4;
}
NCollection_Handle<IntCurve_ThePolygon2d>
aPoly1 = new IntCurve_ThePolygon2d(C1,nbsamplesOnC1,D1,Tol),
aPoly2 = new IntCurve_ThePolygon2d(C2,nbsamplesOnC2,D2,Tol);
@@ -1184,3 +1177,21 @@ void GetIntersection(const TheCurve& theC1, const Standard_Real theT1f, const St
}
}
//=======================================================================
//function : GetMinNbPoints
//purpose :
//=======================================================================
Standard_Integer IntCurve_IntPolyPolyGen::GetMinNbSamples() const
{
return myMinPntNb;
}
//=======================================================================
//function : SetMinNbPoints
//purpose :
//=======================================================================
void IntCurve_IntPolyPolyGen::SetMinNbSamples(const Standard_Integer theMinNbSamples)
{
myMinPntNb = theMinNbSamples;
}