0029351: Boolean Operations create invalid pcurves
[occt.git] / tests / bugs / moddata_2 / bug9303
1 puts "============"
2 puts "OCC9303"
3 puts "============"
4 puts ""
5 ######################################################
6 # Intersection curve surface doesn't take account of bounds of the surface
7 ######################################################
8
9 set BugNumber OCC9303
10
11 cone c 0 0 0 30 0
12 trimv nc c 20 30
13
14 smallview +X+Z
15 donly nc
16 fit
17
18 line ll 0 0 20 1 0 0
19
20 if [catch {intersect res ll nc} result] {
21    set mistake 1
22 } else {
23    set  mistake 0
24 }
25                                                                                                 
26 if { $mistake == 0} {                                                                           
27    puts "${BugNumber} OK : intersection was finished"                 
28    puts ""
29    set nom 0
30    set j 1
31    repeat 2 {
32      set che [whatis res_$j]
33      set err [lindex $che [expr [llength $che] - 1]]
34      if { $err != "point"} {
35         break
36      } else {
37         set nom [expr $nom + 1]
38      }
39      incr j
40    }
41    if { $nom != 2 } {
42       puts [format "Faulty ${BugNumber}: Intersection was made WRONGLY: %s points" $nom]
43    } else {
44       puts [format "${BugNumber} OK : Intersection command works properly: %s points" $nom]
45
46       set dump1 [dump res_1]
47       set x1 [lindex ${dump1} 7]
48       set y1 [lindex ${dump1} 8]
49       set z1 [lindex ${dump1} 9]
50       set x1 [string range ${x1} 0 end-1]
51       set y1 [string range ${y1} 0 end-1]
52
53       set dump2 [dump res_2]
54       set x2 [lindex ${dump2} 7]
55       set y2 [lindex ${dump2} 8]
56       set z2 [lindex ${dump2} 9]
57       set x2 [string range ${x2} 0 end-1]
58       set y2 [string range ${y2} 0 end-1]
59
60       set GoodX1 1.154700538379251e+01
61       set GoodY1 0.000000000000000e+00
62       set GoodZ1 2.000000000000000e+01
63       set GoodX2 -1.154700538379251e+01
64       set GoodY2 0.000000000000000e+00
65       set GoodZ2 2.000000000000000e+01
66
67       checkreal "x1" ${x1} ${GoodX1} 0 0.001
68       checkreal "y1" ${y1} ${GoodY1} 0 0.001
69       checkreal "z1" ${z1} ${GoodZ1} 0 0.001
70       checkreal "x2" ${x2} ${GoodX2} 0 0.001
71       checkreal "y2" ${y2} ${GoodY2} 0 0.001
72       checkreal "z2" ${z2} ${GoodZ2} 0 0.001
73    }
74 } else {
75    puts "Faulty ${BugNumber} : intersection does not finished"
76 }