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

0030354: BOP Cut doesn't modify the attached face

The reason of this problem is in wrong work of classifier algorithm (see the message ~0080992 to the issue #30354). Therefore, the algorithm of IntTools_FClass2d class has been improved. Namely, now orientation of the polygon is computed from area-criterion instead of angle. As result, some simplification of the method IntTools_FClass2d::Init(...) has been made.

<!break>

1. New constructor has been added to the class CSLib_Class2d. It allows applying TColgp_SequenceOfPnt2d.

2. DRAW-commands "addpolygonnode" and "polygonprops" have been created. They are covered by the test case "tests/geometry/2dpolygon/A1".

3. New method Poly::PolygonProperties(...) has been created. See help for detailed information.

4. New testgrid "lowalgos classifier" has been created.
This commit is contained in:
nbv
2018-11-09 10:22:55 +03:00
committed by apn
parent dc57476a0e
commit 5fe14d0fac
27 changed files with 478 additions and 234 deletions

View File

@@ -0,0 +1,21 @@
puts "================"
puts "BUC60609"
puts "================"
restore [locate_data_file buc60609a.brep] a
# two points will be classified
point p1 0.14 5.1
point p2 1.28 5.1
if {![regexp "IN" [b2dclassify a p1]]} {
puts "Faulty BUC60609 first: $first is not right result. It should be INSIDE"
} else {
puts "BUC60609 first OK: It is INSIDE"
}
if {![regexp "IN" [b2dclassify a p2]]} {
puts "Faulty BUC60609 second: $second is not right result. It should be INSIDE"
} else {
puts "BUC60609 second OK: It is INSIDE"
}

View File

@@ -0,0 +1,27 @@
puts "================"
puts "OCC22494"
puts "================"
puts ""
#######################################################################
# BRepClass_FaceClassifier bug (ref SALOME issue 21185)
#######################################################################
set BugNumber OCC22494
restore [locate_data_file bug22494_Pb_belogToGeom_FACE.brep] Face
point p -3.53254182396379145e-05 0.000877856930738714065
set res [split [b2dclassify Face p] ]
set ll [llength ${res}]
if {${ll} < 4} {
puts "Bad format of bclassify draw-command; Faulty ${BugNumber}"
} else {
if {[regexp {The point is ON shape} $res]} {
puts "OK ${BugNumber}"
} else {
puts "Faulty ${BugNumber}"
}
}

View File

@@ -0,0 +1,36 @@
puts "================"
puts "OCC23244"
puts "================"
puts ""
#######################################################################
# Bug of BRepClass_FaceClassifier: it does not take into account the tolerance
#######################################################################
set BugNumber OCC23244
restore [locate_data_file OCC23244-comp.brep] a
explode a
explode a_1
smallview
donly a_1_2 a_3
fit
mkpoint p3 a_3
projponf a_1_2 p3
point pp3 69.220445243320853 1216.6123701316949
set result [split [b2dclassify a_1_2 pp3 1.e-5] ]
set ll [llength ${result}]
if {${ll} < 4} {
puts "Bad format of bclassify draw-command; Faulty ${BugNumber}"
} else {
if { [regexp "ON" $result] == 1 } {
puts "OK ${BugNumber}"
} else {
puts "Faulty ${BugNumber}"
}
}

View File

@@ -0,0 +1,22 @@
puts "================"
puts "OCC23341"
puts "================"
puts ""
#######################################################################
# Wrong result done by 2D classifier algorithm for a point and a face
#######################################################################
set BugNumber OCC23341
restore [locate_data_file bug23341_f1] f1
restore [locate_data_file bug23341_p] p
set info [b2dclassify f1 p]
set check [regexp "OUT" $info]
if { ${check} == 1 } {
puts "OK ${BugNumber}"
} else {
puts "Faulty ${BugNumber}"
}

View File

@@ -0,0 +1,22 @@
puts "================"
puts "OCC23777"
puts "================"
puts ""
#######################################################################
# 2D-Classifier algorithm produces wrong results for a point and face.
#######################################################################
set BugNumber OCC23777
restore [locate_data_file bug23777_b1.brep] b1
point p2D 0.062260538576946696 249583.00418413401
set info [b2dclassify b1 p2D]
set check [regexp "IN" $info]
if { ${check} == 1 } {
puts "OK ${BugNumber}"
} else {
puts "Faulty ${BugNumber}"
}

View File

@@ -0,0 +1,23 @@
puts "================"
puts "OCC23849"
puts "================"
puts ""
#######################################################################
# BOP regression
#######################################################################
set BugNumber OCC23849
restore [locate_data_file bug23849_segment_1.brep] b1
explode b1 f
point p2D 4.1882396063720497 50.643343428894831
set info [b2dclassify b1_1 p2D]
set check [regexp "ON" $info]
if { ${check} == 1 } {
puts "OK ${BugNumber}"
} else {
puts "Faulty ${BugNumber}"
}

View File

@@ -0,0 +1,27 @@
puts "================"
puts "OCC24422"
puts "================"
puts ""
#######################################################################
# Wrong result done by FaceClassifier algorythm
#######################################################################
restore [locate_data_file bug24422_Compound.brep] b
explode b f
copy b_1 f
point p 115.945392440981 106 230.000108990528
point p_proj 230.00010899052799 1925.9453924409811
set info [b2dclassify f p_proj]
if { [regexp "The point is OUT of shape" $info] != 1 } {
puts "Error : point should be ON shape"
} else {
puts "OK: point is OUT of shape"
}
axo
fit
checkview -screenshot -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,37 @@
puts "================"
puts "CR25969"
puts "================"
puts ""
###############################################
## Wrong result obtained by 2d classifier algorithm.
###############################################
pload DCAF
Open [locate_data_file bug25969_pal22851.cbf] D
GetShape D 0:1:15:1:1:2 b1
GetShape D 0:1:29:1:1:2 b2
explode b1
explode b2
bop b1_2 b2_1
bopcut r
explode r f
copy r_4 f
pcurve f
point p 12.658283198213592 21.045164979270297
set cls1 [b2dclassifx f p]
if { [regexp {OUT} $cls1] } {
puts "Error : Wrong result of 2d classifier algorithm"
} else {
puts "OK : Good result of 2d classifier algorithm"
}
smallview
fit
checkview -screenshot -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,37 @@
puts "================"
puts "CR25969"
puts "================"
puts ""
###############################################
## Wrong result obtained by 2d classifier algorithm.
###############################################
pload DCAF
Open [locate_data_file bug25969_pal22851.sgd] D
GetShape D 0:1:15:1:1:2 b1
GetShape D 0:1:29:1:1:2 b2
explode b1
explode b2
bop b1_2 b2_1
bopcut r
explode r f
copy r_4 f
pcurve f
point p 12.658283198213592 21.045164979270297
set cls1 [b2dclassifx f p]
if { [regexp {OUT} $cls1] } {
puts "Error : Wrong result of 2d classifier algorithm"
} else {
puts "OK : Good result of 2d classifier algorithm"
}
smallview
fit
set only_screen_axo 1

View File

@@ -0,0 +1,26 @@
puts "================"
puts "OCC26206"
puts "================"
puts ""
#######################################################################
# BRepClass_FaceClassifier returns TopAbs_OUT for internal point
#######################################################################
restore [locate_data_file bug26206_group_1.brep] a
point p 0.012676794773312086 0.04799218752935417
set info [b2dclassify a p 1e-05]
if { [regexp "The point is IN shape" $info] == 1 } {
puts "OK: point is IN shape"
} else {
puts "Error : point should be IN shape"
}
pcurve a
#v2d2
view 1 -2D- 728 20 400 400
2dfit
xwd ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,21 @@
puts "============"
puts "OCC27434"
puts "============"
puts ""
###############################
## Wrong result of classification of the point in "infinity".
###############################
set BugNumber OCC27434
restore [locate_data_file bug27434_ff.brep] ff
point pp 3.5104958975622309 1.4497931574922160e+031
set info [b2dclassify ff pp]
set check [regexp "OUT" $info]
if { ${check} == 1 } {
puts "OK ${BugNumber}"
} else {
puts "Faulty ${BugNumber}"
}

View File

@@ -0,0 +1,24 @@
puts "============"
puts "0030354: BOP Cut doesn't modify the attached face"
puts "============"
puts ""
restore [locate_data_file bug30354_Face_14.brep] b1
point pp 0.0026084998890765357 0.045000000000000012
if { [ regexp "IN" [b2dclassifx b1 pp] ] != 1 } {
puts "Error: Wrong result of classification"
} else {
puts "OK: good result of classification"
}
if { [ regexp "IN" [b2dclassify b1 pp] ] != 1 } {
puts "Error: Wrong result of classification"
} else {
puts "OK: good result of classification"
}
smallview -2D-
pcurve b1
2dfit
disp pp

View File

@@ -0,0 +1,24 @@
puts "============"
puts "0030354: BOP Cut doesn't modify the attached face"
puts "============"
puts ""
restore [locate_data_file bug30354_Face_14.brep] b1
point pp 0.0046465389982220402 0.045000000000000005
if { [ regexp "ON" [b2dclassifx b1 pp] ] != 1 } {
puts "Error: Wrong result of classification"
} else {
puts "OK: good result of classification"
}
if { [ regexp "ON" [b2dclassify b1 pp] ] != 1 } {
puts "Error: Wrong result of classification"
} else {
puts "OK: good result of classification"
}
smallview -2D-
pcurve b1
2dfit
disp pp

View File

@@ -0,0 +1,22 @@
puts "TODO OCC11111 ALL: Error : OCC377"
pload QAcommands
puts "========"
puts "OCC377"
puts "BUC61056"
puts "========"
puts ""
###################################################################
##Incorrect behaviour of BRepTopAdapter_FClass2d. It cannot work with parametric representation
## of the first wire on the face. It says that point (1.9812, -0.9557948) is outside the contour for
## forward wire and inside for reversed one if tolerance is equal to 6.45
###################################################################
set result_info [ OCC377 [locate_data_file OCC377.brep] 1.9812 -0.9557948 6.45 ]
if { [ regexp {FAULTY} $result_info ]} {
puts "Error : OCC377"
}
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@@ -0,0 +1,25 @@
puts "TODO OCC11111 ALL: Faulty OCC132"
puts "================"
puts "OCC538"
puts "================"
puts ""
restore [locate_data_file OCC538.brep] Face
checkshape Face
point p 0.2453959532714904 -1.246869357124329
set res1 [b2dclassify Face p]
set info_result [split ${res1}]
set ll [llength ${info_result}]
if {${ll} < 4} {
puts "Faulty OCC132"
} else {
if {[regexp {IN} $info_result]} {
puts "OCC132 : OK"
} else {
puts "Faulty OCC132"
}
}