From b7cedc04ced756c892ea51b42ed83289e274f40b Mon Sep 17 00:00:00 2001 From: oan Date: Thu, 16 Jun 2016 16:35:45 +0300 Subject: [PATCH] 0027384: BRepMesh_IncrementalMesh does not take angular deflection into account for spun/elementary surfaces --- src/BRepMesh/BRepMesh.hxx | 1 + src/BRepMesh/BRepMesh_FastDiscretFace.cxx | 251 +++++++++------------- src/BRepMesh/BRepMesh_FastDiscretFace.hxx | 4 - tests/bugs/mesh/bug24127 | 6 +- tests/bugs/mesh/bug25378_1_1 | 4 +- tests/bugs/mesh/bug25378_1_2 | 4 +- tests/bugs/mesh/bug25378_1_3 | 4 +- tests/bugs/mesh/bug25378_3_3 | 4 +- tests/bugs/mesh/bug25519 | 6 +- tests/bugs/moddata_1/bug22759 | 12 +- tests/mesh/begin | 1 + tests/mesh/data/advanced/B6 | 3 +- tests/mesh/data/standard/J8 | 2 +- tests/mesh/data/standard/L8 | 4 + tests/mesh/data/standard/Q7 | 2 +- tests/mesh/data/standard/V5 | 2 +- tests/mesh/data/standard/W7 | 9 +- tests/mesh/data/standard/X3 | 9 + tests/mesh/end | 6 +- 19 files changed, 156 insertions(+), 178 deletions(-) diff --git a/src/BRepMesh/BRepMesh.hxx b/src/BRepMesh/BRepMesh.hxx index 80b2ce0420..47213407a7 100644 --- a/src/BRepMesh/BRepMesh.hxx +++ b/src/BRepMesh/BRepMesh.hxx @@ -93,6 +93,7 @@ namespace BRepMesh typedef NCollection_List ListOfInteger; //! Maps + typedef NCollection_Map MapOfReal; typedef NCollection_Map MapOfInteger; typedef NCollection_DataMap DMapOfTriangulationBool; typedef NCollection_Map MapOfShape; diff --git a/src/BRepMesh/BRepMesh_FastDiscretFace.cxx b/src/BRepMesh/BRepMesh_FastDiscretFace.cxx index cdba30c9d0..d5c9dc190b 100644 --- a/src/BRepMesh/BRepMesh_FastDiscretFace.cxx +++ b/src/BRepMesh/BRepMesh_FastDiscretFace.cxx @@ -93,6 +93,29 @@ static Standard_Real FUN_CalcAverageDUV(TColStd_Array1OfReal& P, const Standard_ namespace { + Standard_Real deflectionOfSegment ( + const gp_Pnt& theFirstPoint, + const gp_Pnt& theLastPoint, + const gp_Pnt& theMidPoint) + { + // 23.03.2010 skl for OCC21645 - change precision for comparison + if (theFirstPoint.SquareDistance (theLastPoint) > Precision::SquareConfusion ()) + { + gp_Lin aLin (theFirstPoint, gp_Dir (gp_Vec (theFirstPoint, theLastPoint))); + return aLin.Distance (theMidPoint); + } + + return theFirstPoint.Distance (theMidPoint); + } + + Standard_Boolean IsCompexSurface (const GeomAbs_SurfaceType theType) + { + return ( + theType != GeomAbs_Sphere && + theType != GeomAbs_Cylinder && + theType != GeomAbs_Cone && + theType != GeomAbs_Torus); + } //! Auxiliary class used to extract geometrical parameters of fixed TopoDS_Vertex. class FixedVExplorer @@ -193,7 +216,7 @@ void BRepMesh_FastDiscretFace::initDataStructure() GeomAbs_SurfaceType thetype = gFace->GetType(); const Standard_Boolean isBSpline = (thetype == GeomAbs_BezierSurface || thetype == GeomAbs_BSplineSurface); - const Standard_Boolean useUVParam = (thetype == GeomAbs_Torus ||isBSpline); + const Standard_Boolean useUVParam = (thetype == GeomAbs_Torus || IsCompexSurface (thetype)); myUParam.Clear(); myVParam.Clear(); @@ -505,28 +528,6 @@ static void filterParameters(const BRepMesh::IMapOfReal& theParams, isCandidateDefined = Standard_True; } theResult.Append(aParamTmp.Last()); - - if( theResult.Length() == 2 ) - { - Standard_Real dist = theResult.Last() - theResult.First(); - Standard_Integer nbint = (Standard_Integer)((dist / theFilterDist) + 0.5); - - if( nbint > 1 ) - { - //Five points more is maximum - if( nbint > 5 ) - { - nbint = 5; - } - - Standard_Integer i; - Standard_Real dU = dist / nbint; - for( i = 1; i < nbint; i++ ) - { - theResult.InsertAfter(i, theResult.First()+i*dU); - } - } - } } void BRepMesh_FastDiscretFace::insertInternalVertices( @@ -552,11 +553,6 @@ void BRepMesh_FastDiscretFace::insertInternalVertices( insertInternalVerticesTorus(theNewVertices); break; - case GeomAbs_BezierSurface: - case GeomAbs_BSplineSurface: - insertInternalVerticesBSpline(theNewVertices); - break; - default: insertInternalVerticesOther(theNewVertices); break; @@ -819,10 +815,10 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesTorus( } //======================================================================= -//function : insertInternalVerticesBSpline +//function : insertInternalVerticesOther //purpose : //======================================================================= -void BRepMesh_FastDiscretFace::insertInternalVerticesBSpline( +void BRepMesh_FastDiscretFace::insertInternalVerticesOther( BRepMesh::ListOfVertex& theNewVertices) { const Standard_Real aRange[2][2] = { @@ -861,22 +857,19 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesBSpline( } // check intermediate isolines - Handle(Geom_Surface) aBSpline; - GeomAbs_SurfaceType aSurfType = gFace->GetType(); - if (aSurfType == GeomAbs_BezierSurface) - aBSpline = gFace->Bezier(); - else if (aSurfType == GeomAbs_BSplineSurface) - aBSpline = gFace->BSpline(); - + Handle (Geom_Surface) aSurface = gFace->ChangeSurface ().Surface ().Surface (); const BRepMesh::HClassifier& aClassifier = myAttribute->ChangeClassifier(); + BRepMesh::MapOfReal aParamsToRemove[2]; + BRepMesh::MapOfReal aParamsForbiddenToRemove[2]; + // precision for compare square distances - const Standard_Real aPrecision = Precision::Confusion(); - const Standard_Real aSqPrecision = aPrecision * aPrecision; + const Standard_Real aPrecision = Precision::Confusion(); for (Standard_Integer k = 0; k < 2; ++k) { + const Standard_Integer aOtherIndex = (k + 1) % 2; BRepMesh::SequenceOfReal& aParams1 = aParams[k]; - BRepMesh::SequenceOfReal& aParams2 = aParams[(k + 1) % 2]; + BRepMesh::SequenceOfReal& aParams2 = aParams[aOtherIndex]; const Standard_Boolean isU = (k == 0); Standard_Integer aStartIndex, aEndIndex; if (isU) @@ -890,31 +883,30 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesBSpline( aEndIndex = aParams1.Length() - 1; } + BRepMesh::MapOfReal& aToRemove2 = aParamsToRemove[aOtherIndex]; + BRepMesh::MapOfReal& aForbiddenToRemove1 = aParamsForbiddenToRemove[k]; + BRepMesh::MapOfReal& aForbiddenToRemove2 = aParamsForbiddenToRemove[aOtherIndex]; for (Standard_Integer i = aStartIndex; i <= aEndIndex; ++i) { const Standard_Real aParam1 = aParams1(i); GeomAdaptor_Curve aIso(isU ? - aBSpline->UIso(aParam1) : aBSpline->VIso(aParam1)); + aSurface->UIso (aParam1) : aSurface->VIso (aParam1)); Standard_Real aPrevParam2 = aParams2(1); - gp_Pnt aPrevPnt2 = aIso.Value(aPrevParam2); + gp_Pnt aPrevPnt2; + gp_Vec aPrevVec2; + aIso.D1 (aPrevParam2, aPrevPnt2, aPrevVec2); for (Standard_Integer j = 2; j <= aParams2.Length();) { Standard_Real aParam2 = aParams2(j); - gp_Pnt aPnt2 = aIso.Value(aParam2); + gp_Pnt aPnt2; + gp_Vec aVec2; + aIso.D1 (aParam2, aPnt2, aVec2); + Standard_Real aMidParam = 0.5 * (aPrevParam2 + aParam2); gp_Pnt aMidPnt = aIso.Value(aMidParam); - // 23.03.2010 skl for OCC21645 - change precision for comparison - Standard_Real aDist; - if (aPrevPnt2.SquareDistance(aPnt2) > aSqPrecision) - { - gp_Lin aLin(aPrevPnt2, gp_Dir(gp_Vec(aPrevPnt2, aPnt2))); - aDist = aLin.Distance(aMidPnt); - } - else - aDist = aPrevPnt2.Distance(aMidPnt); - + Standard_Real aDist = deflectionOfSegment (aPrevPnt2, aPnt2, aMidPnt); if (aDist > aDefFace && aDist > myMinSize) { // insertion @@ -936,14 +928,14 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesBSpline( } gp_Dir N1(0, 0, 1), N2(0, 0, 1); - Standard_Boolean aSt1 = GeomLib::NormEstim(aBSpline, aStPnt1, aPrecision, N1); - Standard_Boolean aSt2 = GeomLib::NormEstim(aBSpline, aStPnt2, aPrecision, N2); + Standard_Boolean aSt1 = GeomLib::NormEstim (aSurface, aStPnt1, aPrecision, N1); + Standard_Boolean aSt2 = GeomLib::NormEstim (aSurface, aStPnt2, aPrecision, N2); - Standard_Real aAngle = N2.Angle(N1); + const Standard_Real aAngle = N2.Angle(N1); if (aSt1 < 1 && aSt2 < 1 && aAngle > myAngle) { - Standard_Real aLen = GCPnts_AbscissaPoint::Length(aIso, - aPrevParam2, aMidParam, aDefFace); + const Standard_Real aLen = GCPnts_AbscissaPoint::Length ( + aIso, aPrevParam2, aMidParam, aDefFace); if (aLen > myMinSize) { @@ -953,8 +945,51 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesBSpline( } } + // Here we should leave at least 3 parameters as far as + // we must have at least one parameter related to surface + // internals in order to prevent movement of triangle body + // outside the surface in case of highly curved ones, e.g. + // BSpline springs. + if (aDist < aDefFace && + aParams2.Length () > 3 && + j < aParams2.Length ()) + { + // Remove too dense points + const Standard_Real aTmpParam = aParams2 (j + 1); + gp_Pnt aTmpPnt; + gp_Vec aTmpVec; + aIso.D1 (aTmpParam, aTmpPnt, aTmpVec); + + Standard_Real aTmpMidParam = 0.5 * (aPrevParam2 + aTmpParam); + gp_Pnt aTmpMidPnt = aIso.Value (aTmpMidParam); + + // Lets check next parameter. + // If it also fits deflection, we can remove previous parameter. + aDist = deflectionOfSegment (aPrevPnt2, aTmpPnt, aTmpMidPnt); + if (aDist < aDefFace) + { + // Lets check parameters for angular deflection. + if (aPrevVec2.Angle (aTmpVec) < myAngle) + { + // For current Iso line we can remove this parameter. + aToRemove2.Add (aParam2); + aParam2 = aTmpParam; + aPnt2 = aTmpPnt; + aVec2 = aTmpVec; + ++j; + } + else { + // We have found a place on the surface refusing + // removement of this parameter. + aForbiddenToRemove1.Add (aParam1); + aForbiddenToRemove2.Add (aParam2); + } + } + } + aPrevParam2 = aParam2; aPrevPnt2 = aPnt2; + aPrevVec2 = aVec2; ++j; } @@ -965,10 +1000,17 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesBSpline( // insert nodes of the regular grid for (Standard_Integer i = 1; i <= aParams[0].Length(); ++i) { - const Standard_Real aParam1 = aParams[0].Value(i); + const Standard_Real aParam1 = aParams[0].Value (i); + if (aParamsToRemove[0].Contains (aParam1) && !aParamsForbiddenToRemove[0].Contains (aParam1)) + continue; + for (Standard_Integer j = 1; j <= aParams[1].Length(); ++j) { - gp_Pnt2d aPnt2d(aParam1, aParams[1].Value(j)); + const Standard_Real aParam2 = aParams[1].Value (j); + if (aParamsToRemove[1].Contains (aParam2) && !aParamsForbiddenToRemove[1].Contains (aParam2)) + continue; + + gp_Pnt2d aPnt2d(aParam1, aParam2); // Classify intersection point if (aClassifier->Perform(aPnt2d) == TopAbs_IN) @@ -981,87 +1023,6 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesBSpline( } } -//======================================================================= -//function : insertInternalVerticesOther -//purpose : -//======================================================================= -void BRepMesh_FastDiscretFace::insertInternalVerticesOther( - BRepMesh::ListOfVertex& theNewVertices) -{ - const Standard_Real aAngle = myAngle;//0.35; - const Standard_Real aRange[2][2] = { - { myAttribute->GetUMax(), myAttribute->GetUMin() }, - { myAttribute->GetVMax(), myAttribute->GetVMin() } - }; - - const Standard_Real aDefFace = myAttribute->GetDefFace(); - const Handle(BRepAdaptor_HSurface)& gFace = myAttribute->Surface(); - - BRepMesh::SequenceOfReal aParams[2]; - const Standard_Integer aIsoPointsNb = 11; - for (Standard_Integer k = 0; k < 2; ++k) - { - const Standard_Boolean isU = (k == 0); - const GeomAbs_IsoType aIsoType = isU ? GeomAbs_IsoU : GeomAbs_IsoV; - const Standard_Integer aOtherParamsIndex = (k + 1) % 2; - const Standard_Real (&aRange1)[2] = aRange[k]; - const Standard_Real (&aRange2)[2] = aRange[aOtherParamsIndex]; - - GCPnts_TangentialDeflection aDiscretIso[aIsoPointsNb]; - const Standard_Real aStepWidth = (aRange1[0] - aRange1[1]) / aIsoPointsNb; - - // Find the most curved Iso. - Standard_Integer aMaxIndex = 1, aMaxPointsNb = 0; - for (Standard_Integer aIsoIt = 0; aIsoIt < aIsoPointsNb; ++aIsoIt) - { - Standard_Real aParam = aRange1[1] + aIsoIt * aStepWidth; - Adaptor3d_IsoCurve aIso(gFace, aIsoType, aParam); - - Standard_Real aFirstParam = Max(aRange2[1], aIso.FirstParameter()); - Standard_Real aLastParam = Min(aRange2[0], aIso.LastParameter()); - - aDiscretIso[aIsoIt].Initialize(aIso, aFirstParam, aLastParam, - aAngle, 0.7 * aDefFace, 2, Precision::PConfusion(), myMinSize); - - const Standard_Integer aPointsNb = aDiscretIso[aIsoIt].NbPoints(); - if (aPointsNb > aMaxPointsNb) - { - aMaxPointsNb = aPointsNb; - aMaxIndex = aIsoIt; - } - } - - BRepMesh::SequenceOfReal& aParams2 = aParams[aOtherParamsIndex]; - GCPnts_TangentialDeflection& aDIso = aDiscretIso[aMaxIndex]; - for (Standard_Integer i = 1; i <= aMaxPointsNb; ++i) - aParams2.Append(aDIso.Parameter(i)); - - if (aParams2.Length() == 2) - aParams2.InsertAfter(1, 0.5 * (aRange2[1] + aRange2[0])); - } - - Adaptor3d_IsoCurve aIsoV; - aIsoV.Load(gFace); - - const BRepMesh::HClassifier& aClassifier = myAttribute->ChangeClassifier(); - const Standard_Integer aUPointsNb = aParams[0].Length(); - const Standard_Integer aVPointsNb = aParams[1].Length(); - for (Standard_Integer i = 2; i < aVPointsNb; ++i) - { - const Standard_Real aV = aParams[1].Value(i); - aIsoV.Load(GeomAbs_IsoV, aV); - - for (Standard_Integer j = 2; j < aUPointsNb; ++j) - { - const Standard_Real aU = aParams[0].Value(j); - - const gp_Pnt2d aNewPoint(aU, aV); - if (aClassifier->Perform(aNewPoint) == TopAbs_IN) - insertVertex(aIsoV.Value(aU), aNewPoint.Coord(), theNewVertices); - } - } -} - //======================================================================= //function : checkDeflectionAndInsert //purpose : @@ -1145,11 +1106,9 @@ Standard_Real BRepMesh_FastDiscretFace::control( const Handle(BRepAdaptor_HSurface)& gFace = myAttribute->Surface(); Handle(Geom_Surface) aBSpline; - GeomAbs_SurfaceType aSurfType = gFace->GetType(); - if (aSurfType == GeomAbs_BezierSurface) - aBSpline = gFace->Bezier(); - else if (aSurfType == GeomAbs_BSplineSurface) - aBSpline = gFace->BSpline(); + const GeomAbs_SurfaceType aSurfType = gFace->GetType (); + if (IsCompexSurface (aSurfType) && aSurfType != GeomAbs_SurfaceOfExtrusion) + aBSpline = gFace->ChangeSurface ().Surface().Surface(); NCollection_DataMap aNorMap; BRepMesh::MapOfIntegerInteger aStatMap; diff --git a/src/BRepMesh/BRepMesh_FastDiscretFace.hxx b/src/BRepMesh/BRepMesh_FastDiscretFace.hxx index 66e05b1c73..0e66df33f7 100644 --- a/src/BRepMesh/BRepMesh_FastDiscretFace.hxx +++ b/src/BRepMesh/BRepMesh_FastDiscretFace.hxx @@ -108,10 +108,6 @@ private: //! @param theNewVertices list of vertices to be extended and added to mesh. void insertInternalVerticesTorus(BRepMesh::ListOfVertex& theNewVertices); - //! Calculates nodes lying on Bezier/BSpline surface. - //! @param theNewVertices list of vertices to be extended and added to mesh. - void insertInternalVerticesBSpline(BRepMesh::ListOfVertex& theNewVertices); - //! Calculates nodes lying on custom-type surface. //! @param theNewVertices list of vertices to be extended and added to mesh. void insertInternalVerticesOther(BRepMesh::ListOfVertex& theNewVertices); diff --git a/tests/bugs/mesh/bug24127 b/tests/bugs/mesh/bug24127 index 16dbac7dcf..542aacdde5 100755 --- a/tests/bugs/mesh/bug24127 +++ b/tests/bugs/mesh/bug24127 @@ -19,15 +19,15 @@ regexp {([0-9]+) triangles} ${trinfo_s} str nbtri_s regexp {([0-9]+) nodes} ${trinfo_s} str nbnod_s regexp {deflection ([0-9.+e-]+)} ${trinfo_s} str defl_s -if { ${nbtri_s} != 99 } { +if { ${nbtri_s} != 17 } { puts "Error: triangle number is bad" } -if { ${nbnod_s} != 59 } { +if { ${nbnod_s} != 18 } { puts "Error: node number is bad" } -set expected_defl_s 0.59663444648536146 +set expected_defl_s 0.3345840532742983 set tol_abs_defl_s 1.e-3 set tol_rel_defl_s 0.01 checkreal "Deflection" ${defl_s} ${expected_defl_s} ${tol_abs_defl_s} ${tol_rel_defl_s} diff --git a/tests/bugs/mesh/bug25378_1_1 b/tests/bugs/mesh/bug25378_1_1 index 7a560437e5..3ab8cef57c 100755 --- a/tests/bugs/mesh/bug25378_1_1 +++ b/tests/bugs/mesh/bug25378_1_1 @@ -24,9 +24,9 @@ if { [regexp {Debug mode} [dversion]] } { set max_t_1 20 } else { if { [regexp {Windows} [dversion]] } { - set max_t_1 15 + set max_t_1 0 } else { - set max_t_1 20 + set max_t_1 0 } } diff --git a/tests/bugs/mesh/bug25378_1_2 b/tests/bugs/mesh/bug25378_1_2 index fd56f719a5..d307ddb15c 100755 --- a/tests/bugs/mesh/bug25378_1_2 +++ b/tests/bugs/mesh/bug25378_1_2 @@ -24,9 +24,9 @@ if { [regexp {Debug mode} [dversion]] } { set max_t_01 180 } else { if { [regexp {Windows} [dversion]] } { - set max_t_01 90 + set max_t_01 1 } else { - set max_t_01 90 + set max_t_01 1 } } diff --git a/tests/bugs/mesh/bug25378_1_3 b/tests/bugs/mesh/bug25378_1_3 index 8cee3ebf07..eaf05994b7 100755 --- a/tests/bugs/mesh/bug25378_1_3 +++ b/tests/bugs/mesh/bug25378_1_3 @@ -25,9 +25,9 @@ if { [regexp {Debug mode} [dversion]] } { set max_t_001 600 } else { if { [regexp {Windows} [dversion]] } { - set max_t_001 360 + set max_t_001 184 } else { - set max_t_001 400 + set max_t_001 184 } } diff --git a/tests/bugs/mesh/bug25378_3_3 b/tests/bugs/mesh/bug25378_3_3 index 274598f445..fe30be428c 100644 --- a/tests/bugs/mesh/bug25378_3_3 +++ b/tests/bugs/mesh/bug25378_3_3 @@ -18,9 +18,9 @@ if { [regexp {Debug mode} [dversion]] } { set max_t_001 50 } else { if { [regexp {Windows} [dversion]] } { - set max_t_001 20 + set max_t_001 14 } else { - set max_t_001 55 + set max_t_001 14 } } diff --git a/tests/bugs/mesh/bug25519 b/tests/bugs/mesh/bug25519 index 73501ff6bb..45c9aac08e 100755 --- a/tests/bugs/mesh/bug25519 +++ b/tests/bugs/mesh/bug25519 @@ -20,9 +20,9 @@ regexp {([0-9]+) triangles} ${trinfo_s} str nbtri_s regexp {([0-9]+) nodes} ${trinfo_s} str nbnod_s regexp {deflection ([0-9.+e-]+)} ${trinfo_s} str defl_s -set good_nbtri 2721 -set good_nbnod 1405 -set good_defl 0.044436924588798624 +set good_nbtri 1779 +set good_nbnod 936 +set good_defl 0.10452721084309395 set good_percent 5 diff --git a/tests/bugs/moddata_1/bug22759 b/tests/bugs/moddata_1/bug22759 index c7befea4f9..a8f153e5e5 100755 --- a/tests/bugs/moddata_1/bug22759 +++ b/tests/bugs/moddata_1/bug22759 @@ -30,14 +30,14 @@ regexp {deflection +([-0-9.+eE]+)} $tri_info full defl set env(os_type) $tcl_platform(platform) if { [string compare $env(os_type) "windows"] != 0 } { puts "OS = Linux" - set good_tri 520414 - set good_nod 263938 - set good_defl 0.0026800432954056617 + set good_tri 392920 + set good_nod 200191 + set good_defl 0.0092442421472207319 } else { puts "OS = Windows NT" - set good_tri 520414 - set good_nod 263938 - set good_defl 0.0026800432954056617 + set good_tri 392920 + set good_nod 200191 + set good_defl 0.0092442421472207319 } proc GetPercent {Value GoodValue} { diff --git a/tests/mesh/begin b/tests/mesh/begin index 5d6a7d4ad4..4442d0f5bf 100755 --- a/tests/mesh/begin +++ b/tests/mesh/begin @@ -3,6 +3,7 @@ set percent_max 5. # relative tolerance (%) set rel_tol 1 +set max_rel_tol_diff 0 set area_eps 0 diff --git a/tests/mesh/data/advanced/B6 b/tests/mesh/data/advanced/B6 index 4a9a082fb5..caa23af7f5 100755 --- a/tests/mesh/data/advanced/B6 +++ b/tests/mesh/data/advanced/B6 @@ -3,5 +3,6 @@ if { [string compare $command "incmesh"] == 0 || [string compare $command "mesh"] == 0 || [string compare $command "incmesh_parallel"] == 0 } { set bug_area "OCC25519" - set rel_tol 1.3485 + set max_rel_tol_diff 1 + set rel_tol 0.91 } diff --git a/tests/mesh/data/standard/J8 b/tests/mesh/data/standard/J8 index 15e36fbb1a..92f29bcc48 100755 --- a/tests/mesh/data/standard/J8 +++ b/tests/mesh/data/standard/J8 @@ -1,5 +1,5 @@ set TheFileName shading_089.brep if { [string compare $command "shading"] != 0 } { set bug_area "OCC22687" - set rel_tol 10 + set rel_tol 1.42 } diff --git a/tests/mesh/data/standard/L8 b/tests/mesh/data/standard/L8 index 1645dc02aa..d2e464eb64 100755 --- a/tests/mesh/data/standard/L8 +++ b/tests/mesh/data/standard/L8 @@ -1 +1,5 @@ set TheFileName shading_107.brep +if { [string compare $command "shading"] == 0 } { + set bug_freelinks "L8" + set nbfree(All) 96 +} diff --git a/tests/mesh/data/standard/Q7 b/tests/mesh/data/standard/Q7 index a18ed5e62d..386828c832 100755 --- a/tests/mesh/data/standard/Q7 +++ b/tests/mesh/data/standard/Q7 @@ -1,3 +1,3 @@ set TheFileName shading_151.brep set bug_area "OCC22687" -set rel_tol 3.15 +set rel_tol 3.12 diff --git a/tests/mesh/data/standard/V5 b/tests/mesh/data/standard/V5 index 84d661b645..4b69fa6804 100755 --- a/tests/mesh/data/standard/V5 +++ b/tests/mesh/data/standard/V5 @@ -1,5 +1,5 @@ set TheFileName shading_wrongshape_016.brep if { [string compare $command "shading"] == 0 } { set bug_area "OCC22687" - set rel_tol 1.28 + set rel_tol 0.47 } diff --git a/tests/mesh/data/standard/W7 b/tests/mesh/data/standard/W7 index cc79f61406..bc5e498e50 100755 --- a/tests/mesh/data/standard/W7 +++ b/tests/mesh/data/standard/W7 @@ -1,9 +1,12 @@ set TheFileName shading_wrongshape_027.brep set bug_freenodes "OCC22687" -set nbfreenodes(All) 2 +#set nbfreenodes(All) 2 +set max_rel_tol_diff 1 if { [string compare $command "shading"] != 0 } { - set bug_area "OCC22687" - set rel_tol 1.1 + #set bug_area "OCC22687" + set rel_tol 2.13 +} else { + set rel_tol 0.48 } set nbcross(All) 2 set bug_cross "OCC23184" diff --git a/tests/mesh/data/standard/X3 b/tests/mesh/data/standard/X3 index 625a2abf72..cf919367a3 100644 --- a/tests/mesh/data/standard/X3 +++ b/tests/mesh/data/standard/X3 @@ -3,3 +3,12 @@ set TheFileName "" restore [locate_data_file OCC358a.brep] f restore [locate_data_file OCC358b.brep] w pipe res w f + +set bug_area "OCC358" +set max_rel_tol_diff 1 +puts $command +if { [string compare $command "shading"] == 0 } { + set rel_tol 1.67 +} else { + set rel_tol 0.676 +} \ No newline at end of file diff --git a/tests/mesh/end b/tests/mesh/end index ee661224d6..172f127985 100644 --- a/tests/mesh/end +++ b/tests/mesh/end @@ -148,9 +148,13 @@ set rel_err [expr abs([CheckTriArea res $area_eps])] if { $rel_err > $rel_tol } { puts "Error : area by triangles differs from the actual area by $rel_err %" } else { + if { [info exists max_rel_tol_diff] && $max_rel_tol_diff > 0 } { + checkreal "area difference" $rel_err $rel_tol $max_rel_tol_diff 0 + } else { if { $rel_tol > 1 && $rel_tol < 100 } { - puts "Error: Improvement: The current area difference is $rel_err instead of $rel_tol" + puts "Error: Improvement: The current area difference is $rel_err instead of $rel_tol" } + } } # Check if topology of mesh is valid -- 2.39.5