0029807: [Regression to 7.0.0] Impossible to cut cone from prism
[occt.git] / tests / bugs / modalg_5 / bug24811
CommitLineData
1a25084d 1puts "============"
2puts "OCC24811"
3puts "============"
4puts ""
5#################################
6# Intersection is insufficient
7#################################
8
9set p1_1 -2.22458486160362e-016
10set p1_2 1
11set p1_3 0
12
13set p2_1 0.0202691578002498
14set p2_2 0.999794559518151
15set p2_3 0
16
17restore [locate_data_file bug24811_e1.brep] curve
18restore [locate_data_file bug24811_e2.brep] circle
19
20bop curve circle
21bopcut result
1a25084d 22
9526aa6a 23if { [llength [explode result]] != 4 } {
24 puts "Error: wrong number of intersections. Should be result_1 result_2 result_3 result_4"
1a25084d 25} else {
26 puts "OK: right number of intersections"
27}
28
9526aa6a 29explode result_2
30set info1 [dump result_2_1]
1a25084d 31regexp {Point 3D +: +([-0-9.+eE]+), +([-0-9.+eE]+), +([-0-9.+eE]+)} $info1 full x1 y1 z1
32regexp {Tolerance +: +([-0-9.+eE]+)} $info1 full tol1
33
34if { $p1_1 >= [expr $x1 - $tol1] && $p1_1 <= [expr $x1 + $tol1] } {
35 puts "OK: point1_1 is correct"
36} else {
37 puts "Error: point1_1 is incorrect"
38}
39if { $p1_2 >= [expr $y1 - $tol1] && $p1_2 <= [expr $y1 + $tol1] } {
40 puts "OK: point1_2 is correct"
41} else {
42 puts "Error: point1_2 is incorrect"
43}
44if { $p1_3 >= [expr $z1 - $tol1] && $p1_3 <= [expr $z1 + $tol1] } {
45 puts "OK: point1_3 is correct"
46} else {
47 puts "Error: point1_3 is incorrect"
48}
49
50
9526aa6a 51set info2 [dump result_2_2]
1a25084d 52regexp {Point 3D +: +([-0-9.+eE]+), +([-0-9.+eE]+), +([-0-9.+eE]+)} $info2 full x2 y2 z2
53regexp {Tolerance +: +([-0-9.+eE]+)} $info2 full tol2
54
55if { $p2_1 >= [expr $x2 - $tol2] && $p2_1 <= [expr $x2 + $tol2] } {
56 puts "OK: point2_1 is correct"
57} else {
58 puts "Error: point2_1 is incorrect"
59}
60if { $p2_2 >= [expr $y2 - $tol2] && $p2_2 <= [expr $y2 + $tol2] } {
61 puts "OK: point2_2 is correct"
62} else {
63 puts "Error: point2_2 is incorrect"
64}
65if { $p2_3 >= [expr $z2 - $tol2] && $p2_3 <= [expr $z2 + $tol2] } {
66 puts "OK: point2_3 is correct"
67} else {
68 puts "Error: point2_3 is incorrect"
69}
70
5747059b 71checkview -display result -2d -path ${imagedir}/${test_image}.png