0030315: Data Exchange - Crash reading views during STEP import.
[occt.git] / tests / lowalgos / intss / bug29972_3
1 puts "========"
2 puts "OCC29972: Intersection curve has a weird gap in the middle of it"
3 puts "========"
4 puts ""
5
6 set GoodNbCurves 6
7
8 foreach a [directory res*] {unset $a}
9
10 torus s1 -127 84 100 0 0 -1 1 0 0 23 10
11 cylinder s2 -132 61.5500556793564 131 0 0 -1 1 0 0 10
12
13 intersect res s1 s2 1.0e-4
14
15 if { [info exists res] } {
16   #Only variable "res" exists
17   renamevar res res_1
18 }
19
20 bclearobjects
21 bcleartools
22
23 set ic 1
24 set AllowRepeat 1
25 while { $AllowRepeat != 0 } {
26   if { ![info exists res_$ic] } {
27     set AllowRepeat 0
28   } else {
29     bounds res_$ic U1 U2
30     
31     if {[dval U2-U1] < 1.0e-9} {
32       puts "Error: Wrong curve's range!"
33     }
34     
35     xdistcs res_$ic s1 U1 U2 100 2.0e-7
36     xdistcs res_$ic s2 U1 U2 100 2.0e-7
37     
38     mkedge ee res_$ic
39     baddobjects ee
40     
41     incr ic
42   }
43 }
44
45 # Check of gaps between intersection curves
46 bfillds
47 bbuild rs
48
49 checknbshapes rs -edge $GoodNbCurves
50
51 regexp {nb alone Vertices : ([-0-9.+eE]+)} [ checksection rs -r 4 ] full nbv
52 if { $nbv < 2 } {
53   puts "Error : The section is closed. The result is possible to better than on MASTER version. Please check carefully."
54 } else {
55   for {set i 1} {$i < $nbv} {incr i} {
56     for {set j [expr $i +1] } {$j <= $nbv} {incr j} {
57       distmini dd alone_$i alone_$j;
58       
59       if { [dval dd_val] > 3.0e-6 } {
60         puts "Error: The distance between alone_$i and alone_$j is too big"
61       }
62     }
63   }
64 }
65
66 smallview
67 don res_*
68
69 fit
70 don s1 s2
71 disp res_*
72
73 checkview -screenshot -2d -path ${imagedir}/${test_image}.png