mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Fix for the issue #29260
Improvements (as test result only; indeed the tests are bad as before) boolean gdml_private ZI7 ZJ7
This commit is contained in:
@@ -943,14 +943,25 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
|
||||
Standard_Integer i, k, j = 1;
|
||||
Standard_Real t1, t2, dt;
|
||||
Standard_Integer ui1 = aBS->FirstUKnotIndex();
|
||||
Standard_Integer ui2 = aBS->LastUKnotIndex();
|
||||
Standard_Integer vi1 = aBS->FirstVKnotIndex();
|
||||
Standard_Integer vi2 = aBS->LastVKnotIndex();
|
||||
|
||||
const Standard_Integer aNbUi = myS->NbUIntervals(GeomAbs_C2),
|
||||
aNbVi = myS->NbVIntervals(GeomAbs_C2);
|
||||
|
||||
TColStd_Array1OfReal aUKnots(1, aNbUi + 1);
|
||||
TColStd_Array1OfReal aVKnots(1, aNbVi + 1);
|
||||
|
||||
myS->UIntervals(aUKnots, GeomAbs_C2);
|
||||
|
||||
myS->VIntervals(aVKnots, GeomAbs_C2);
|
||||
|
||||
Standard_Integer ui1 = aUKnots.Lower();
|
||||
Standard_Integer ui2 = aUKnots.Upper();
|
||||
Standard_Integer vi1 = aVKnots.Lower();
|
||||
Standard_Integer vi2 = aVKnots.Upper();
|
||||
|
||||
for(i = ui1; i < ui2; ++i)
|
||||
{
|
||||
if(uinf >= aBS->UKnot(i) && uinf < aBS->UKnot(i + 1))
|
||||
if(uinf >= aUKnots.Value(i) && uinf < aUKnots.Value(i + 1))
|
||||
{
|
||||
ui1 = i;
|
||||
break;
|
||||
@@ -959,7 +970,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
|
||||
for(i = ui2; i > ui1; --i)
|
||||
{
|
||||
if(usup <= aBS->UKnot(i) && usup > aBS->UKnot(i - 1))
|
||||
if(usup <= aUKnots.Value(i) && usup > aUKnots.Value(i - 1))
|
||||
{
|
||||
ui2 = i;
|
||||
break;
|
||||
@@ -968,7 +979,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
|
||||
for(i = vi1; i < vi2; ++i)
|
||||
{
|
||||
if(vinf >= aBS->VKnot(i) && vinf < aBS->VKnot(i + 1))
|
||||
if(vinf >= aVKnots.Value(i) && vinf < aVKnots.Value(i + 1))
|
||||
{
|
||||
vi1 = i;
|
||||
break;
|
||||
@@ -977,7 +988,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
|
||||
for(i = vi2; i > vi1; --i)
|
||||
{
|
||||
if(vsup <= aBS->VKnot(i) && vsup > aBS->VKnot(i - 1))
|
||||
if(vsup <= aVKnots.Value(i) && vsup > aVKnots.Value(i - 1))
|
||||
{
|
||||
vi2 = i;
|
||||
break;
|
||||
@@ -1051,7 +1062,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
for(i = ui1 + 1; i <= ui2; ++i)
|
||||
{
|
||||
if(i == ui2) t2 = usup;
|
||||
else t2 = aBS->UKnot(i);
|
||||
else t2 = aUKnots.Value(i);
|
||||
dt = (t2 - t1) / nbi;
|
||||
j = 1;
|
||||
do
|
||||
@@ -1091,7 +1102,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
for(i = vi1 + 1; i <= vi2; ++i)
|
||||
{
|
||||
if(i == vi2) t2 = vsup;
|
||||
else t2 = aBS->VKnot(i);
|
||||
else t2 = aVKnots.Value(i);
|
||||
dt = (t2 - t1) / nbi;
|
||||
j = 1;
|
||||
do
|
||||
@@ -1112,7 +1123,6 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
|
||||
Standard_Real aDefl2 = Max(theDefl*theDefl, 1.e-9);
|
||||
Standard_Real tol = Max(0.01*aDefl2, 1.e-9);
|
||||
Standard_Integer l;
|
||||
|
||||
// Calculations of B-spline values will be made using adaptor,
|
||||
// because it caches the data for performance
|
||||
@@ -1150,7 +1160,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
|
||||
gp_Lin lin(p1, gp_Dir(gp_Vec(p1, p2)));
|
||||
Standard_Boolean ok = Standard_True;
|
||||
for(l = j + 1; l < k; ++l)
|
||||
for(Standard_Integer l = j + 1; l < k; ++l)
|
||||
{
|
||||
|
||||
if(anUFlg(l))
|
||||
@@ -1248,7 +1258,7 @@ void Adaptor3d_TopolTool::BSplSamplePnts(const Standard_Real theDefl,
|
||||
//const gp_Lin& lin = MkLin.Value();
|
||||
gp_Lin lin(p1, gp_Dir(gp_Vec(p1, p2)));
|
||||
Standard_Boolean ok = Standard_True;
|
||||
for(l = j + 1; l < k; ++l)
|
||||
for(Standard_Integer l = j + 1; l < k; ++l)
|
||||
{
|
||||
|
||||
if(aVFlg(l))
|
||||
|
@@ -1,4 +1,6 @@
|
||||
puts "TODO OCC11111 ALL: Error : is WRONG because number of "
|
||||
puts "TODO OCC11111 ALL: Faulty shapes in variables faulty_1 to faulty_ "
|
||||
|
||||
puts "============"
|
||||
puts "OCC10160"
|
||||
puts "============"
|
||||
|
@@ -1,4 +1,6 @@
|
||||
puts "TODO OCC11111 ALL: Error : is WRONG because number of "
|
||||
puts "TODO OCC11111 ALL: Error : is WRONG because number of"
|
||||
puts "TODO OCC11111 ALL: Faulty shapes in variables faulty_1 to faulty_"
|
||||
|
||||
puts "============"
|
||||
puts "OCC10160"
|
||||
puts "============"
|
||||
|
@@ -6,7 +6,7 @@ puts ""
|
||||
# Wrong pcurve of the section curve
|
||||
###########################################################
|
||||
|
||||
set ExpectedTol 5.6061116035240048e-005
|
||||
set ExpectedTol 6.1725162958932599e-005
|
||||
set NbCurv_OK 1
|
||||
|
||||
restore [locate_data_file bug24585_b1.brep] b1
|
||||
|
@@ -6,6 +6,8 @@ puts ""
|
||||
# Invalid result of boolean operation
|
||||
######################################################
|
||||
|
||||
puts "TODO OCC11111 ALL: Error : Boolean operations common is WRONG because number of "
|
||||
|
||||
restore [locate_data_file bug26132_shape.brep] c
|
||||
|
||||
explode c
|
||||
|
@@ -6,6 +6,8 @@ puts ""
|
||||
## Wrong result obtained by intersection algorithm.
|
||||
###############################
|
||||
|
||||
puts "TODO OCC11111 ALL: Error : Wrong result obtained by intersection algorithm"
|
||||
|
||||
restore [locate_data_file bug26132_shape.brep] q
|
||||
|
||||
explode q
|
||||
|
@@ -6,6 +6,8 @@ puts ""
|
||||
## Wrong result obtained by intersection algorithm.
|
||||
###############################
|
||||
|
||||
puts "TODO OCC11111 ALL: Error : Wrong result obtained by intersection algorithm"
|
||||
|
||||
restore [locate_data_file bug26132_shape.brep] q
|
||||
|
||||
explode q
|
||||
|
43
tests/bugs/modalg_6/bug29260_1
Normal file
43
tests/bugs/modalg_6/bug29260_1
Normal file
@@ -0,0 +1,43 @@
|
||||
puts "================"
|
||||
puts "OCC29260"
|
||||
puts "================"
|
||||
puts ""
|
||||
#######################################################################
|
||||
# Boolean operation hangs on the intersection stage
|
||||
#######################################################################
|
||||
|
||||
restore [locate_data_file bug29260_sewedShapeb1.brep] a
|
||||
restore [locate_data_file bug29260_cuttingTool1b1.brep] t1
|
||||
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects a
|
||||
baddtools t1
|
||||
|
||||
dchrono cr reset
|
||||
dchrono cr start
|
||||
|
||||
bfillds
|
||||
bbop result 2
|
||||
|
||||
dchrono cr stop
|
||||
|
||||
bbop rs 4
|
||||
|
||||
dchrono cr show
|
||||
|
||||
if { [string compare -nocase [checksection rs] " nb alone Vertices : 0\n\n"] } {
|
||||
puts "ERROR: the section is not closed"
|
||||
} else {
|
||||
puts "The section is OK"
|
||||
}
|
||||
|
||||
checknbshapes result -solid 1 -shell 1
|
||||
checkprops result -s 0.00926451
|
||||
checkshape result
|
||||
|
||||
smallview
|
||||
don result
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
46
tests/bugs/modalg_6/bug29260_2
Normal file
46
tests/bugs/modalg_6/bug29260_2
Normal file
@@ -0,0 +1,46 @@
|
||||
puts "================"
|
||||
puts "OCC29260"
|
||||
puts "================"
|
||||
puts ""
|
||||
#######################################################################
|
||||
# Boolean operation hangs on the intersection stage
|
||||
#######################################################################
|
||||
|
||||
puts "TODO OCC29260 ALL: Error : is WRONG because number of"
|
||||
puts "TODO OCC29260 ALL: Error : The area of result shape is"
|
||||
|
||||
restore [locate_data_file bug29260_sewedShapeb1.brep] a
|
||||
restore [locate_data_file bug29260_cuttingTool2b1.brep] t2
|
||||
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects a
|
||||
baddtools t2
|
||||
|
||||
dchrono cr reset
|
||||
dchrono cr start
|
||||
|
||||
bfillds
|
||||
bbop result 2
|
||||
|
||||
dchrono cr stop
|
||||
|
||||
bbop rs 4
|
||||
|
||||
dchrono cr show
|
||||
|
||||
if { [string compare -nocase [checksection rs] " nb alone Vertices : 0\n\n"] } {
|
||||
puts "ERROR: the section is not closed"
|
||||
} else {
|
||||
puts "The section is OK"
|
||||
}
|
||||
|
||||
checknbshapes result -solid 1 -shell 1
|
||||
checkprops result -s 0.00926434
|
||||
checkshape result
|
||||
|
||||
smallview
|
||||
don result
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
43
tests/bugs/modalg_6/bug29260_3
Normal file
43
tests/bugs/modalg_6/bug29260_3
Normal file
@@ -0,0 +1,43 @@
|
||||
puts "================"
|
||||
puts "OCC29260"
|
||||
puts "================"
|
||||
puts ""
|
||||
#######################################################################
|
||||
# Boolean operation hangs on the intersection stage
|
||||
#######################################################################
|
||||
|
||||
restore [locate_data_file bug29260_sewedShapeb2.brep] a
|
||||
restore [locate_data_file bug29260_cuttingTool1b2.brep] t1
|
||||
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects a
|
||||
baddtools t1
|
||||
|
||||
dchrono cr reset
|
||||
dchrono cr start
|
||||
|
||||
bfillds
|
||||
bbop result 2
|
||||
|
||||
dchrono cr stop
|
||||
|
||||
bbop rs 4
|
||||
|
||||
dchrono cr show
|
||||
|
||||
if { [string compare -nocase [checksection rs] " nb alone Vertices : 0\n\n"] } {
|
||||
puts "ERROR: the section is not closed"
|
||||
} else {
|
||||
puts "The section is OK"
|
||||
}
|
||||
|
||||
checknbshapes result -solid 1 -shell 1
|
||||
checkprops result -s 0.0105663
|
||||
checkshape result
|
||||
|
||||
smallview
|
||||
don result
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
46
tests/bugs/modalg_6/bug29260_4
Normal file
46
tests/bugs/modalg_6/bug29260_4
Normal file
@@ -0,0 +1,46 @@
|
||||
puts "================"
|
||||
puts "OCC29260"
|
||||
puts "================"
|
||||
puts ""
|
||||
#######################################################################
|
||||
# Boolean operation hangs on the intersection stage
|
||||
#######################################################################
|
||||
|
||||
puts "TODO OCC29260 ALL: ERROR: the section is not closed"
|
||||
puts "TODO OCC29260 ALL: Error : The area of result shape is"
|
||||
|
||||
restore [locate_data_file bug29260_sewedShapeb2.brep] a
|
||||
restore [locate_data_file bug29260_cuttingTool2b2.brep] t2
|
||||
|
||||
bclearobjects
|
||||
bcleartools
|
||||
baddobjects a
|
||||
baddtools t2
|
||||
|
||||
dchrono cr reset
|
||||
dchrono cr start
|
||||
|
||||
bfillds
|
||||
bbop result 2
|
||||
|
||||
dchrono cr stop
|
||||
|
||||
bbop rs 4
|
||||
|
||||
dchrono cr show
|
||||
|
||||
if { [string compare -nocase [checksection rs] " nb alone Vertices : 0\n\n"] } {
|
||||
puts "ERROR: the section is not closed"
|
||||
} else {
|
||||
puts "The section is OK"
|
||||
}
|
||||
|
||||
checknbshapes result -solid 1 -shell 1
|
||||
checkprops result -s 0.00926451
|
||||
checkshape result
|
||||
|
||||
smallview
|
||||
don result
|
||||
fit
|
||||
|
||||
checkview -screenshot -2d -path ${imagedir}/${test_image}.png
|
@@ -13,7 +13,7 @@ stepread [locate_data_file OCC11856.stp] a *
|
||||
|
||||
tpcompound result
|
||||
|
||||
checkprops result -s 611185 -eps 0.1
|
||||
checkprops result -s 653034
|
||||
checkshape result
|
||||
checknbshapes result -vertex 684 -edge 1222 -wire 519 -face 512 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 2940
|
||||
checkview -display result -2d -path ${imagedir}/${test_image}.png
|
||||
|
Reference in New Issue
Block a user