0028802: The tolerance reached by approximator is used in creation of an edge, it...
[occt.git] / tests / bugs / modalg_6 / bug27937_2
CommitLineData
d07a6c39 1puts "================"
2puts "OCC27937"
3puts "================"
4puts ""
5#######################################################################
6# 0027937: Intersector loops infinitely while proceeding two simple surfaces
7#######################################################################
8
9cpulimit 100
10
11# Attention!!!
12# The test on performance meter.
13# See issue #27937 for detail.
14set GoodNbCurv 4
15
16ellipse c1 0 0 0 0 0 1 6.03031367203927 3.11993062568844
17extsurf s1 c1 0 0 1
18cylinder s2 0 0 0 1 0 0 0.249128788767645
19
20intersect result s1 s2
21
22set che [whatis result]
23set ind [string first "3d curve" $che]
24if {${ind} >= 0} {
25 #Only variable "result" exists
26 renamevar result result_1
27}
28
29set ic 1
30set AllowRepeate 1
31while { $AllowRepeate != 0 } {
32 set che [whatis result_$ic]
33 set ind [string first "3d curve" $che]
34 if {${ind} < 0} {
35 set AllowRepeate 0
36 } else {
37 display result_$ic
38
39 bounds result_$ic U1 U2
40
41 dump U1 U2
42
43 if {[dval U2-U1] < 1.0e-9} {
44 puts "Error: Wrong curve's range!"
45 }
46
47 xdistcs result_$ic s1 U1 U2 10 4.0e-5
48 xdistcs result_$ic s2 U1 U2 10 1.0e-5
49
50 for { set ip [expr $ic-1] } { $ip > 0 } { incr ip -1 } {
51 mkedge e1 result_$ic
52 mkedge e2 result_$ip
53
54 set coe [checkoverlapedges e1 e2 5.0e-5]
55
56 puts "result_$ic <-> result_$ip: $coe"
57 if { [regexp "Edges is not overlaped" $coe] != 1 } {
58 puts "Error: result_$ic and result_$ip are overlaped"
59 }
60 }
61
62 incr ic
63 }
64}
65
66if {[expr {$ic - 1}] == $GoodNbCurv} {
67 puts "OK: Number of curves is good!"
68} else {
69 puts "Error: $GoodNbCurv is expected but [expr {$ic - 1}] is found!"
70}
71
72smallview
73don result*
74fit
75clear
76don s1 s2 result*
77checkview -screenshot -2d -path ${imagedir}/${test_image}.png