Wrong distance computation has been corrected.
Some test-cases have been corrected according to their new behavior. Namely, built (by approximation algorithm) curve(s) has changed its geometrical position.
1. tests/blend/simple/X4
It is not a regression because the result is not correct on both MASTER and FIX (see explanation in the issue #26740). This problem is expected to be solved after porting Fillet-algorithm to new Boolean operation. Old Boolean operations do not cover Edge-Edge tangent-zone by vertex.
2. tests/bugs/modalg_6/bug27341_318
"checknbshapes" has been deleted in order to avoid non-stable behavior (see issue #29360) of this test case. New result is OK on both Linux and Windows platform.
const Standard_Integer lastP,
math_Vector& TheParameters) const
{
- Standard_Integer i, j, Nbp, nbP2d, nbP3d;
+ Standard_Integer i, j, nbP2d, nbP3d;
Standard_Real dist;
- gp_Pnt P1, P2;
- gp_Pnt2d P12d, P22d;
- Nbp = lastP-firstP+1;
+ const Standard_Integer aNbp = lastP - firstP + 1;
- if (Nbp == 2) {
+ if (aNbp == 2) {
TheParameters(firstP) = 0.0;
TheParameters(lastP) = 1.0;
}
- else if (Par == Approx_ChordLength || Par == Approx_Centripetal) {
+ else if(Par == Approx_ChordLength || Par == Approx_Centripetal)
+ {
nbP3d = LineTool::NbP3d(Line);
nbP2d = LineTool::NbP2d(Line);
- Standard_Integer mynbP3d=nbP3d, mynbP2d=nbP2d;
- if (nbP3d == 0) mynbP3d = 1;
- if (nbP2d == 0) mynbP2d = 1;
+ Standard_Integer mynbP3d = nbP3d, mynbP2d = nbP2d;
+ if(nbP3d == 0) mynbP3d = 1;
+ if(nbP2d == 0) mynbP2d = 1;
TheParameters(firstP) = 0.0;
dist = 0.0;
TColgp_Array1OfPnt2d tabP2d(1, mynbP2d);
TColgp_Array1OfPnt2d tabPP2d(1, mynbP2d);
- for (i = firstP+1; i <= lastP; i++) {
- if (nbP3d != 0 && nbP2d != 0) LineTool::Value(Line, i-1, tabP, tabP2d);
- else if (nbP2d != 0) LineTool::Value(Line, i-1, tabP2d);
- else if (nbP3d != 0) LineTool::Value(Line, i-1, tabP);
-
- if (nbP3d != 0 && nbP2d != 0) LineTool::Value(Line, i, tabPP, tabPP2d);
- else if (nbP2d != 0) LineTool::Value(Line, i, tabPP2d);
- else if (nbP3d != 0) LineTool::Value(Line, i, tabPP);
- dist = 0;
- for (j = 1; j <= nbP3d; j++) {
- P1 = tabP(j);
- P2 = tabPP(j);
- dist += P2.Distance(P1);
+ for(i = firstP + 1; i <= lastP; i++)
+ {
+ if(nbP3d != 0 && nbP2d != 0) LineTool::Value(Line, i - 1, tabP, tabP2d);
+ else if(nbP2d != 0) LineTool::Value(Line, i - 1, tabP2d);
+ else if(nbP3d != 0) LineTool::Value(Line, i - 1, tabP);
+
+ if(nbP3d != 0 && nbP2d != 0) LineTool::Value(Line, i, tabPP, tabPP2d);
+ else if(nbP2d != 0) LineTool::Value(Line, i, tabPP2d);
+ else if(nbP3d != 0) LineTool::Value(Line, i, tabPP);
+ dist = 0.0;
+ for(j = 1; j <= nbP3d; j++)
+ {
+ const gp_Pnt &aP1 = tabP(j),
+ &aP2 = tabPP(j);
+ dist += aP2.SquareDistance(aP1);
}
- for (j = 1; j <= nbP2d; j++) {
- P12d = tabP2d(j);
- P22d = tabPP2d(j);
- dist += P22d.Distance(P12d);
+ for(j = 1; j <= nbP2d; j++)
+ {
+ const gp_Pnt2d &aP12d = tabP2d(j),
+ &aP22d = tabPP2d(j);
+
+ dist += aP22d.SquareDistance(aP12d);
}
- dist = dist/(nbP3d+nbP2d);
-
+ dist = Sqrt(dist);
if(Par == Approx_ChordLength)
- TheParameters(i) = TheParameters(i-1) + dist;
- else {// Par == Approx_Centripetal
- TheParameters(i) = TheParameters(i-1) + Sqrt(dist);
+ {
+ TheParameters(i) = TheParameters(i - 1) + dist;
+ }
+ else
+ {// Par == Approx_Centripetal
+ TheParameters(i) = TheParameters(i - 1) + Sqrt(dist);
}
}
- for (i = firstP; i <= lastP; i++) TheParameters(i) /= TheParameters(lastP);
+ for(i = firstP; i <= lastP; i++) TheParameters(i) /= TheParameters(lastP);
}
else {
for (i = firstP; i <= lastP; i++) {
{
Standard_Integer i, j, nbP2d, nbP3d;
Standard_Real dist;
- gp_Pnt P1, P2;
- gp_Pnt2d P12d, P22d;
- if (Par == Approx_ChordLength || Par == Approx_Centripetal) {
+ if(Par == Approx_ChordLength || Par == Approx_Centripetal)
+ {
nbP3d = LineTool::NbP3d(Line);
nbP2d = LineTool::NbP2d(Line);
- Standard_Integer mynbP3d=nbP3d, mynbP2d=nbP2d;
- if (nbP3d == 0) mynbP3d = 1;
- if (nbP2d == 0) mynbP2d = 1;
+ Standard_Integer mynbP3d = nbP3d, mynbP2d = nbP2d;
+ if(nbP3d == 0) mynbP3d = 1;
+ if(nbP2d == 0) mynbP2d = 1;
TheParameters(firstP) = 0.0;
dist = 0.0;
TColgp_Array1OfPnt2d tabP2d(1, mynbP2d);
TColgp_Array1OfPnt2d tabPP2d(1, mynbP2d);
- for (i = firstP+1; i <= lastP; i++) {
- if (nbP3d != 0 && nbP2d != 0) LineTool::Value(Line, i-1, tabP, tabP2d);
- else if (nbP2d != 0) LineTool::Value(Line, i-1, tabP2d);
- else if (nbP3d != 0) LineTool::Value(Line, i-1, tabP);
+ for(i = firstP + 1; i <= lastP; i++)
+ {
+ if(nbP3d != 0 && nbP2d != 0) LineTool::Value(Line, i - 1, tabP, tabP2d);
+ else if(nbP2d != 0) LineTool::Value(Line, i - 1, tabP2d);
+ else if(nbP3d != 0) LineTool::Value(Line, i - 1, tabP);
- if (nbP3d != 0 && nbP2d != 0) LineTool::Value(Line, i, tabPP, tabPP2d);
- else if (nbP2d != 0) LineTool::Value(Line, i, tabPP2d);
- else if (nbP3d != 0) LineTool::Value(Line, i, tabPP);
+ if(nbP3d != 0 && nbP2d != 0) LineTool::Value(Line, i, tabPP, tabPP2d);
+ else if(nbP2d != 0) LineTool::Value(Line, i, tabPP2d);
+ else if(nbP3d != 0) LineTool::Value(Line, i, tabPP);
dist = 0;
- for (j = 1; j <= nbP3d; j++) {
- P1 = tabP(j);
- P2 = tabPP(j);
- dist += P2.Distance(P1);
+ for(j = 1; j <= nbP3d; j++)
+ {
+ const gp_Pnt &aP1 = tabP(j),
+ &aP2 = tabPP(j);
+ dist += aP2.SquareDistance(aP1);
}
- for (j = 1; j <= nbP2d; j++) {
- P12d = tabP2d(j);
- P22d = tabPP2d(j);
- dist += P22d.Distance(P12d);
+ for(j = 1; j <= nbP2d; j++)
+ {
+ const gp_Pnt2d &aP12d = tabP2d(j),
+ &aP22d = tabPP2d(j);
+
+ dist += aP22d.SquareDistance(aP12d);
}
+
+ dist = Sqrt(dist);
if(Par == Approx_ChordLength)
- TheParameters(i) = TheParameters(i-1) + dist;
- else {// Par == Approx_Centripetal
- TheParameters(i) = TheParameters(i-1) + Sqrt(dist);
+ {
+ TheParameters(i) = TheParameters(i - 1) + dist;
+ }
+ else
+ {// Par == Approx_Centripetal
+ TheParameters(i) = TheParameters(i - 1) + Sqrt(dist);
}
}
- for (i = firstP; i <= lastP; i++) TheParameters(i) /= TheParameters(lastP);
+ for(i = firstP; i <= lastP; i++) TheParameters(i) /= TheParameters(lastP);
}
else {
for (i = firstP; i <= lastP; i++) {
{
Standard_Integer i, j, nbP2d, nbP3d;
Standard_Real dist;
- gp_Pnt P1, P2;
- gp_Pnt2d P12d, P22d;
if (Par == Approx_ChordLength || Par == Approx_Centripetal) {
nbP3d = ApproxInt_TheMultiLineTool::NbP3d(Line);
else if (nbP3d != 0) ApproxInt_TheMultiLineTool::Value(Line, i, tabPP);
dist = 0;
for (j = 1; j <= nbP3d; j++) {
- P1 = tabP(j);
- P2 = tabPP(j);
- dist += P2.Distance(P1);
+ const gp_Pnt &aP1 = tabP(j),
+ &aP2 = tabPP(j);
+ dist += aP2.SquareDistance(aP1);
}
for (j = 1; j <= nbP2d; j++) {
- P12d = tabP2d(j);
- P22d = tabPP2d(j);
- dist += P22d.Distance(P12d);
+ const gp_Pnt2d &aP12d = tabP2d(j),
+ &aP22d = tabPP2d(j);
+
+ dist += aP22d.SquareDistance(aP12d);
}
+
+ dist = Sqrt(dist);
if(Par == Approx_ChordLength)
- TheParameters(i) = TheParameters(i-1) + dist;
- else {// Par == Approx_Centripetal
- TheParameters(i) = TheParameters(i-1) + Sqrt(dist);
+ {
+ TheParameters(i) = TheParameters(i - 1) + dist;
+ }
+ else
+ {// Par == Approx_Centripetal
+ TheParameters(i) = TheParameters(i - 1) + Sqrt(dist);
}
}
for (i = firstP; i <= lastP; i++) TheParameters(i) /= TheParameters(lastP);
+puts "TODO #OCC26740 ALL: Faulty shapes in variables faulty_1 to faulty_2"
+
## ===========================================
## Grid : CCV001
## Test : H1
set log [bopcurves a_1 a_2 -2d -p 0.20639206339545224 0.69260832843385300 0.0 0.017002507022347624]
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Tolerance_Reached NbCurv
-set expected_Tolerance_Reached 2.4318051256224198e-07
+set expected_Tolerance_Reached 2.8312498500210269e-07
set tol_abs_Tolerance_Reached 0.0
set tol_rel_Tolerance_Reached 1.0e-2
checkreal "Tolerance Reached" ${Tolerance_Reached} ${expected_Tolerance_Reached} ${tol_abs_Tolerance_Reached} ${tol_rel_Tolerance_Reached}
# Wrong pcurve of the section curve
###########################################################
-set ExpectedTol 6.0859390083974326e-005
+set ExpectedTol 9.8986150909815383e-05
set NbCurv_OK 1
restore [locate_data_file bug24585_b1.brep] b1
regexp {Tolerance +MAX=([-0-9.+eE]+)} [tolerance result] full MaxTolerance
-set expected_MaxTolerance 0.0068942263920076944
+set expected_MaxTolerance 0.0069008006175832973
set tol_abs_MaxTolerance 0.0
set tol_rel_MaxTolerance 1.0e-4
checkreal "MaxTolerance" ${MaxTolerance} ${expected_MaxTolerance} ${tol_abs_MaxTolerance} ${tol_rel_MaxTolerance}
## [Regression to 6.9.1] smesh/bugs_00/A6: Cut produces an empty shape
###############################
-set MaxTol 3.8178537637632889e-006
+set MaxTol 2.1243683206633536e-006
set GoodNbCurv 1
restore [locate_data_file bug27282_cmpd.brep] a
## Invalid curves number in intersection result
###############################
-set MaxTol 6.899054167648517e-007
+set MaxTol 6.5952839365451194e-008
set GoodNbCurv 1
restore [locate_data_file CTO900_pro12913a.rle] a
fit
checkprops result -l 278.784
-checknbshapes result -vertex 14 -edge 7
+checknbshapes result -vertex 16 -edge 8
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
fit
checkprops result -l 337.535
-checknbshapes result -vertex 20 -edge 10
+checknbshapes result -vertex 22 -edge 11
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
fit
checkprops result -l 1030.62
-checknbshapes result -vertex 256 -edge 129
+checknbshapes result -vertex 254 -edge 128
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
fit
checkprops result -l 534.882
-checknbshapes result -vertex 318 -edge 159
+checknbshapes result -vertex 324 -edge 162
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
fit
checkprops result -l 2429.7
-checknbshapes result -vertex 381 -edge 191
-
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
fit
checkprops result -l 755.552
-checknbshapes result -vertex 378 -edge 189
+checknbshapes result -vertex 454 -edge 227
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
# Incomplete intersection curve from the attached shapes
#################################################
-set ExpTol 1.0e-7
+set ExpTol 1.1e-7
set GoodNbCurv 3
set GoodLength 0.6288896355727489
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log2} full Tolerance_Reached2 NbCurv2
set expected_Tolerance_Reached1 2.2611960020325053e-007
-set expected_Tolerance_Reached2 7.6423429413334924e-006
+set expected_Tolerance_Reached2 5.0364838664362801e-006
checkreal "Tolerance Reached" ${Tolerance_Reached1} ${expected_Tolerance_Reached1} ${tol_abs_Tolerance_Reached} ${tol_rel_Tolerance_Reached}
checkreal "Tolerance Reached" ${Tolerance_Reached2} ${expected_Tolerance_Reached2} ${tol_abs_Tolerance_Reached} ${tol_rel_Tolerance_Reached}
#######################################################################
set NbCurvGood 1
-set ExpToler 7.1928004468800293e-008
+set ExpToler 5.441959818453312e-008
restore [locate_data_file bug28009_shape.brep] a
# Very slow boolean cut operations on cylinders
#################################################
-set ExpTol1 3.2300230820477792e-007
-set ExpTol2 3.2198007889220219e-007
+set ExpTol 3.32e-07
set GoodNbCurv 4
set log [bopcurves b1_1 b2_1 -2d]
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
-checkreal ToleranceReached ${Toler} ${ExpTol1} 0.0 0.01
+checkreal ToleranceReached ${Toler} ${ExpTol} 0.0 0.01
if {${NbCurv} != ${GoodNbCurv}} {
puts "Error: Number of curves is bad!"
set log [bopcurves b2_1 b1_1 -2d]
regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
-checkreal ToleranceReached ${Toler} ${ExpTol2} 0.0 0.01
+checkreal ToleranceReached ${Toler} ${ExpTol} 0.0 0.01
if {${NbCurv} != ${GoodNbCurv}} {
puts "Error: Number of curves is bad!"