0026196: Wrong result obtained by projection algorithm.
[occt.git] / tests / bugs / modalg_6 / bug26196
CommitLineData
7afe616f 1puts "========"
2puts "OCC26196"
3puts "========"
4puts ""
5#################################################
6# Wrong result obtained by projection algorithm
7#################################################
8
9restore [locate_data_file OCC26196-Face.brep] f
10
11explode f e
12mkcurve c f_1
13mksurface s f
14trim st s 1.33305 4.31185 -1.56174 0.415831
15project c2d c st
16
17set bug_info [dump c2d]
18set bug_info [string trim [string range $bug_info [expr {[string first "KnotsPoles :" $bug_info] + 12}] [string length $bug_info]]]
19set bug_info [string trim [string range $bug_info 0 [expr {[string first "Knots :" $bug_info] - 1}]]]
20set bug_info_length [llength $bug_info]
21
22set beg_X [lindex $bug_info 2]
23set beg_X [string range $beg_X 0 [expr {[string length $beg_X] - 2}]]
24set beg_Y [lindex $bug_info 3]
25
26set end_X [lindex $bug_info [expr {$bug_info_length - 2}]]
27set end_X [string range $end_X 0 [expr {[string length $end_X] - 2}]]
28set end_Y [lindex $bug_info [expr {$bug_info_length - 1}]]
29
30if {$beg_X > $end_X} {
31 set diff_X [expr {$beg_X - $end_X}]
32} else {
33 set diff_X [expr {$end_X - $beg_X}]
34}
35if {$beg_Y > $end_Y} {
36 set diff_Y [expr {$beg_Y - $end_Y}]
37} else {
38 set diff_Y [expr {$end_Y - $beg_Y}]
39}
40
41if {$diff_X > 1.e-06 || $diff_Y > 1.e-06} {
42 puts "ERROR: OCC26196 is reproduced. Projection is wrong."
43}