0030082: Intersection algorithm returns curve with big tolerance value
[occt.git] / tests / bugs / modalg_7 / bug30082_2
CommitLineData
7eb3580b 1puts "========"
2puts "0030082: Intersection algorithm returns curve with big tolerance value"
3puts "========"
4puts ""
5
6foreach a [directory res*] {unset $a}
7
8set aTol 1.0e-4
9set GoodNbCurves 4
10
11cylinder s1 -106.471129473161 -64.3442185874231 -19.25 1 0 0 0 0 -1 0.25
12cylinder s2 -124.971129473161 -67.0942185874231 -20.5 0 0 1 1 0 -0 3
13intersect res s1 s2 $aTol
14
15set che [whatis res]
16set ind [string first "3d curve" $che]
17if {${ind} >= 0} {
18 #Only variable "res" exists
19 renamevar res res_1
20}
21
22bclearobjects
23bcleartools
24
25set ic 1
26set AllowRepeat 1
27while { $AllowRepeat != 0 } {
28 set che [whatis res_$ic]
29 set ind [string first "3d curve" $che]
30 if {${ind} < 0} {
31 set AllowRepeat 0
32 } else {
33 bounds res_$ic U1 U2
34
35 if {[dval U2-U1] < 1.0e-9} {
36 puts "Error: Wrong curve's range!"
37 }
38
39 xdistcs res_$ic s1 U1 U2 100 $aTol
40 xdistcs res_$ic s2 U1 U2 100 $aTol
41
42 mkedge ee res_$ic
43 baddobjects ee
44 incr ic
45 }
46}
47
48incr ic -1
49
50if { $ic != $GoodNbCurves } {
51 puts "Error: $GoodNbCurves curves are expected but $ic ones are found"
52}
53
54bfillds
55bbuild result
56
57smallview
58don result
59fit
60
61# Check gaps between edges in ce
62checksection result -r 0
63checkmaxtol result -min_tol 2.0e-7
64
65checknbshapes result -edge 4 -vertex 3
66
67checkview -screenshot -2d -path ${imagedir}/${test_image}.png