0025890: Intersection algorithm produces curves overlaped
[occt.git] / tests / bugs / moddata_3 / bug23471
CommitLineData
9d32c463 1puts "TODO OCC26190 ALL: Error: Curve Number is bad"
2puts "TODO OCC26190 ALL: Error: Length of intersection line is bad!"
3
a7dd5d0f 4puts "============"
5puts "CR23471"
6puts "============"
7puts ""
8#######################################################################
9# Intersection algorithm produces overlapping intersection curves
10#######################################################################
11
9d32c463 12# Attention!!!!
13# Change these values is strictly forbidden (see bug #26190)
14set GoodNbCurv 1
15set GoodLength 79655.615367318111
16
a7dd5d0f 17restore [locate_data_file OCC22790-cx.brep] b
18
19explode b
20mksurface s1 b_1
21mksurface s2 b_3
22intersect res s1 s2
23
9d32c463 24set che [whatis res]
25set ind [string first "3d curve" $che]
26if {${ind} >= 0} {
27 #Only variable "res" exists
28 copy res res_1
a7dd5d0f 29}
9d32c463 30
31set SumLength 0
32
33set ic 1
34set AllowRepeate 1
35while { $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
50set NbCurv [expr {$ic - 1}]
51if {$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
57if { 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}