1a25084d |
1 | puts "============" |
2 | puts "OCC24811" |
3 | puts "============" |
4 | puts "" |
5 | ################################# |
6 | # Intersection is insufficient |
7 | ################################# |
8 | |
9 | set p1_1 -2.22458486160362e-016 |
10 | set p1_2 1 |
11 | set p1_3 0 |
12 | |
13 | set p2_1 0.0202691578002498 |
14 | set p2_2 0.999794559518151 |
15 | set p2_3 0 |
16 | |
17 | restore [locate_data_file bug24811_e1.brep] curve |
18 | restore [locate_data_file bug24811_e2.brep] circle |
19 | |
20 | bop curve circle |
21 | bopcut result |
22 | explode result |
23 | |
24 | if { [llength [explode result_1]] != 4 } { |
25 | puts "Error: wrong number of intersections. Should be result_1_1 result_1_2 result_1_3 result_1_4" |
26 | } else { |
27 | puts "OK: right number of intersections" |
28 | } |
29 | |
30 | explode result_1_2 |
31 | set info1 [dump result_1_2_1] |
32 | regexp {Point 3D +: +([-0-9.+eE]+), +([-0-9.+eE]+), +([-0-9.+eE]+)} $info1 full x1 y1 z1 |
33 | regexp {Tolerance +: +([-0-9.+eE]+)} $info1 full tol1 |
34 | |
35 | if { $p1_1 >= [expr $x1 - $tol1] && $p1_1 <= [expr $x1 + $tol1] } { |
36 | puts "OK: point1_1 is correct" |
37 | } else { |
38 | puts "Error: point1_1 is incorrect" |
39 | } |
40 | if { $p1_2 >= [expr $y1 - $tol1] && $p1_2 <= [expr $y1 + $tol1] } { |
41 | puts "OK: point1_2 is correct" |
42 | } else { |
43 | puts "Error: point1_2 is incorrect" |
44 | } |
45 | if { $p1_3 >= [expr $z1 - $tol1] && $p1_3 <= [expr $z1 + $tol1] } { |
46 | puts "OK: point1_3 is correct" |
47 | } else { |
48 | puts "Error: point1_3 is incorrect" |
49 | } |
50 | |
51 | |
52 | set info2 [dump result_1_2_2] |
53 | regexp {Point 3D +: +([-0-9.+eE]+), +([-0-9.+eE]+), +([-0-9.+eE]+)} $info2 full x2 y2 z2 |
54 | regexp {Tolerance +: +([-0-9.+eE]+)} $info2 full tol2 |
55 | |
56 | if { $p2_1 >= [expr $x2 - $tol2] && $p2_1 <= [expr $x2 + $tol2] } { |
57 | puts "OK: point2_1 is correct" |
58 | } else { |
59 | puts "Error: point2_1 is incorrect" |
60 | } |
61 | if { $p2_2 >= [expr $y2 - $tol2] && $p2_2 <= [expr $y2 + $tol2] } { |
62 | puts "OK: point2_2 is correct" |
63 | } else { |
64 | puts "Error: point2_2 is incorrect" |
65 | } |
66 | if { $p2_3 >= [expr $z2 - $tol2] && $p2_3 <= [expr $z2 + $tol2] } { |
67 | puts "OK: point2_3 is correct" |
68 | } else { |
69 | puts "Error: point2_3 is incorrect" |
70 | } |
71 | |
72 | set 2dviewer 1 |