0025952: Wrong intersection curve
[occt.git] / tests / lowalgos / intss / bug23471
1 puts "TODO OCC26190 ALL: Error: Curve Number is bad"
2 puts "TODO OCC26190 ALL: Error: Length of intersection line is bad!"
3
4 puts "============"
5 puts "CR23471"
6 puts "============"
7 puts ""
8 #######################################################################
9 # Intersection algorithm produces overlapping intersection curves
10 #######################################################################
11
12 # Attention!!!!
13 # Change these values is strictly forbidden (see bug #26190)
14 set GoodNbCurv 1
15 set GoodLength 79655.615367318111
16
17 restore [locate_data_file OCC22790-cx.brep] b
18
19 explode b
20 mksurface s1 b_1
21 mksurface s2 b_3
22 intersect res s1 s2
23
24 set che [whatis res]
25 set ind [string first "3d curve" $che]
26 if {${ind} >= 0} {
27   #Only variable "res" exists
28   copy res res_1
29 }
30
31 set SumLength 0
32
33 set ic 1
34 set AllowRepeate 1
35 while { $AllowRepeate != 0 } {
36   set che [whatis res_$ic]
37   set ind [string first "3d curve" $che]
38   if {${ind} < 0} {
39     set AllowRepeate 0
40   } else {
41     set log [length res_$ic]
42     set exp_string "The length res_$ic is +(\[-0-9.+eE\]+)"
43     regexp ${exp_string} ${log} full len
44     set SumLength [expr $SumLength+$len]
45
46     incr ic
47   }
48 }
49
50 set NbCurv [expr {$ic - 1}]
51 if {$NbCurv == $GoodNbCurv} {
52   puts "OK: Curve Number is good!"
53 } else {
54   puts "Error: Curve Number is bad ($NbCurv curve(s) found, but $GoodNbCurv expected)!"
55 }
56
57 if { abs($SumLength - $GoodLength) < 0.01*$GoodLength } {
58   puts "OK: Length of intersection line is good!"
59 } else {
60   puts "Error: Length of intersection line is bad!"
61   puts "Expected length is: $GoodLength"
62   puts "Found length is:    $SumLength"
63 }