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

Compare commits

..

1 Commits

Author SHA1 Message Date
astromko
cf709a713c 0033648: Modeling Algorithms - Bad partition result
Removed unnecessary tolerance increase for Line\Line intersection.
Tolerance increasing logic for some specific curve types
  was added with #26619.
Original fix had no test for Line/Line case and
  theoretically was added as a possible issue.
After research Line/Line case doesn't need a special tolerance case.
2024-08-21 14:22:03 +01:00
3 changed files with 29 additions and 36 deletions

View File

@@ -341,12 +341,8 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange)
GeomAbs_CurveType aType1 = aBAC1.GetType();
GeomAbs_CurveType aType2 = aBAC2.GetType();
//
bAnalytical = (((aType1 == GeomAbs_Line) &&
(aType2 == GeomAbs_Line ||
aType2 == GeomAbs_Circle)) ||
((aType2 == GeomAbs_Line) &&
(aType1 == GeomAbs_Line ||
aType1 == GeomAbs_Circle)));
bAnalytical = (aType1 == GeomAbs_Line && aType2 == GeomAbs_Circle) ||
(aType1 == GeomAbs_Circle && aType2 == GeomAbs_Line);
}
//
for (i=1; i<=aNbCPrts; ++i) {
@@ -443,7 +439,7 @@ void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange)
Standard_Real aTolVnew = BRep_Tool::Tolerance(aVnew);
if (bAnalytical) {
// increase tolerance for Line/Line intersection, but do not update
// increase tolerance for Line/Circle intersection, but do not update
// the vertex till its intersection with some other shape
Standard_Real aTolMin = (BRepAdaptor_Curve(aE1).GetType() == GeomAbs_Line) ?
(aCR1.Last() - aCR1.First()) / 2. : (aCR2.Last() - aCR2.First()) / 2.;

View File

@@ -16,7 +16,6 @@
#include <ElCLib.hxx>
#include <Extrema_ExtPC.hxx>
#include <gce_MakeCirc.hxx>
#include <Geom_BezierCurve.hxx>
#include <Geom_BSplineCurve.hxx>
@@ -25,7 +24,6 @@
#include <Geom_Ellipse.hxx>
#include <Geom_Line.hxx>
#include <Geom_TrimmedCurve.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <gp_Ax2.hxx>
#include <gp_Ax3.hxx>
#include <gp_Circ.hxx>
@@ -624,33 +622,6 @@ if (Q2 > 0 && Q1*Q3 < 0) {
cl = ElCLib::InPeriod(cl, cm, cm + PI2);
res = gell;
// reverse test for 20 points for cases of very thin and long ellipse (#30752)
if ((1 - anEllipse.Eccentricity()) < tol)
{
GeomAdaptor_Curve anAdpt(c3d);
Extrema_ExtPC aProj;
aProj.Initialize(anAdpt, c1, c2);
Standard_Real aTol2 = tol * tol;
Standard_Real aDelta = (cl - cf) / 20;
for (int aPntId = 1; aPntId <= 20; aPntId++)
{
gp_Pnt anEllPnt = res->Value(cf + aPntId * aDelta);
aProj.Perform(anEllPnt);
if (aProj.IsDone())
{
Standard_Real anExtDist = aProj.SquareDistance(1);
for (int anExtInd = 2; anExtInd <= aProj.NbExt(); anExtInd++)
{
Standard_Real aDist = aProj.SquareDistance(anExtInd);
if (anExtDist < aDist)
aDist = anExtDist;
}
if (anExtDist > aTol2)
return NULL; // not done
}
}
}
}
}
/*

View File

@@ -0,0 +1,26 @@
puts "==================================================="
puts "0033648: Modeling Algorithms - Bad partition result"
puts "==================================================="
puts ""
pload MODELING
restore [locate_data_file bug33648_1.brep] s1
restore [locate_data_file bug33648_2.brep] s2
baddobjects s1 s2
bfillds
bbuild result
checkprops result -s 87.2813
checknbshapes result -vertex 58 -edge 97 -wire 44 -face 44 -shell 4 -solid 4 -compsolid 0 -compound 2 -shape 253
set expected_MaxTolerance 0.05
regexp {Tolerance +MAX=([-0-9.+eE]+)} [tolerance result] full MaxTolerance
if { $MaxTolerance > $expected_MaxTolerance } {
puts "Error : too big tolerance for the shape (should be less than $expected_MaxTolerance, now $MaxTolerance)"
}
vinit
vdisplay result
vfit
checkview -screenshot -3d -path ${imagedir}/${test_image}.png