0029807: [Regression to 7.0.0] Impossible to cut cone from prism
[occt.git] / tests / bugs / moddata_2 / bug565
1 puts "========"
2 puts "OCC565: Can not intersect two trimmed conical surfaces"
3 puts "========"
4 puts ""
5
6 set GoodNbCurv 1
7
8 foreach c [directory result*] {
9   unset $c
10 }
11
12 foreach c [directory inf*] {
13   unset $c
14 }
15
16 restore [locate_data_file OCC565a.draw] s1 
17 restore [locate_data_file OCC565b.draw] s2 
18
19 puts "Preliminary check: intersection work with infinite cones:"
20 if { [catch {intersect inf s1 s2 } catch_result] } {
21   puts "Faulty OCC565: function intersection works wrongly with infinite cones"
22 } else {
23   set isFound 0
24   foreach c [directory inf*] {
25     set ind [string first "3d curve" [whatis $c]]
26     if {${ind} < 0} {
27       dump $c
28       puts "Error: Intersection result (with infinite cones) is not 3D-curve"
29     } else {
30       set isFound 1
31     }
32   }
33   
34   if { !$isFound } {
35     puts "Error: Empty intersection result (with infinite cones)"    
36   }
37 }
38
39 trim s1x s1 0 2*pi 0 2.8
40 trim s2x s2 0 2*pi 0 2.8
41
42 if { [catch {intersect result s1x s2x } catch_result] } {
43   puts "Faulty OCC565 exception: function intersection works wrongly with trimmed cones"
44 } else {
45   foreach c [directory result*] {
46     bounds $c U1 U2
47     
48     if {[dval U2-U1] < 1.0e-9} {
49       puts "Error: Wrong curve's range!"
50     }
51     
52     xdistcs $c s1 U1 U2 10 1.0e-7
53     xdistcs $c s2 U1 U2 10 1.0e-7
54   }
55
56   set NbCurv [llength [directory result*]]
57
58   if { $NbCurv == $GoodNbCurv } {
59     puts "OK: Number of curves is good!"
60   } else {
61     puts "Error: $GoodNbCurv is expected but $NbCurv is found!"
62   }
63
64   smallview
65   don result*
66   fit
67   disp s1x s2x
68   checkview -screenshot -2d -path ${imagedir}/${test_image}.png
69 }
70
71