a87752f3 |
1 | puts "================" |
e121dd4d |
2 | puts "OCC333: Superimposed curves during intersection two surfaces " |
a87752f3 |
3 | puts "================" |
4 | puts "" |
e121dd4d |
5 | |
6 | set GoodNbCurv 14 |
7 | |
8 | restore [locate_data_file OCC333a.draw] s1 |
9 | restore [locate_data_file OCC333b.draw] s2 |
10 | |
11 | intersect result s1 s2 |
12 | |
13 | set che [whatis result] |
14 | set ind [string first "3d curve" $che] |
15 | if {${ind} >= 0} { |
16 | #Only variable "result" exists |
17 | renamevar result result_1 |
18 | } |
19 | |
20 | set ic 1 |
21 | set AllowRepeate 1 |
22 | while { $AllowRepeate != 0 } { |
23 | set che [whatis result_$ic] |
24 | set ind [string first "3d curve" $che] |
25 | if {${ind} < 0} { |
26 | set AllowRepeate 0 |
27 | } else { |
28 | display result_$ic |
29 | |
30 | bounds result_$ic U1 U2 |
31 | |
32 | dump U1 U2 |
33 | |
34 | if {[dval U2-U1] < 1.0e-9} { |
35 | puts "Error: Wrong curve's range!" |
a87752f3 |
36 | } |
e121dd4d |
37 | |
38 | xdistcs result_$ic s1 U1 U2 10 2.0e-7 |
39 | xdistcs result_$ic s2 U1 U2 10 2.0e-7 |
40 | |
41 | for { set ip [expr $ic-1] } { $ip > 0 } { incr ip -1 } { |
42 | mkedge e1 result_$ic |
43 | mkedge e2 result_$ip |
44 | |
45 | set coe [checkoverlapedges e1 e2 5.0e-5] |
46 | |
47 | puts "result_$ic <-> result_$ip: $coe" |
7b5e532f |
48 | if { [regexp "Edges are not overlapped" $coe] != 1 } { |
49 | puts "Error: result_$ic and result_$ip are overlapped" |
e121dd4d |
50 | } |
51 | } |
52 | |
53 | incr ic |
54 | } |
a87752f3 |
55 | } |
56 | |
e121dd4d |
57 | incr ic -1 |
58 | |
59 | if {$ic == $GoodNbCurv} { |
60 | puts "OK: Number of curves is good!" |
61 | } else { |
62 | puts "Error: $GoodNbCurv curves are expected but $ic ones are found!" |
63 | } |
64 | |
65 | smallview |
66 | don result* |
67 | fit |
68 | clear |
69 | don s1 s2 result* |
70 | |
71 | checkview -screenshot -2d -path ${imagedir}/${test_image}.png |