Restoring test cases removed by last commit.
[occt.git] / tests / bugs / moddata / bug311_2
CommitLineData
a87752f3 1puts "========"
2puts "OCC311"
3puts "========"
4
5restore [locate_data_file OCC311.draw] c
6#### checkshape c # - not a topological shape
7
8set ufirst 1e-7
9set ulast 6.2831854071795897
10
11segment c ${ufirst} ${ulast}
12
13set dumpc [dump c]
14
15set list [split ${dumpc} "\n\t"]
16set listLength [llength ${list}]
17if { ${listLength} < 25 } {
18 puts "OCC311 - Error : listLength= ${listLength}"
19}
20
21regexp { +Degree +([-0-9.+eE]+), +([-0-9.+eE]+) +Poles, +([-0-9.+eE]+) +Knots} $dumpc full DegreeNumber PolesNumber KnotsNumber
22
23set Knots [regexp -all -inline { +([-0-9.+eE]+ +: +[-0-9.+eE]+ +[-0-9.+eE]+)} $dumpc]
24regexp { *[-0-9.+eE]+ +: +([-0-9.+eE]+) +[-0-9.+eE]+} [lindex $Knots 1] full FirstKnot
25regexp { *[-0-9.+eE]+ +: +([-0-9.+eE]+) +[-0-9.+eE]+} [lindex $Knots [llength $Knots]-1] full LastKnot
26
27set delta_first [expr abs(${FirstKnot} - ${ufirst}) / ${ufirst} * 100]
28set delta_last [expr abs(${LastKnot} - ${ulast}) / ${ulast} * 100]
29
30set maxdelta 0.01
31
32puts "FirstKnot = ${FirstKnot}"
33puts "LastKnot = ${LastKnot}"
34
35if { ${delta_first} > ${maxdelta} } {
36 puts "OCC311 - Error : delta_first = ${delta_first}"
37}
38if { ${delta_last} > ${maxdelta} } {
39 puts "OCC311 - Error : delta_last = ${delta_last}"
40}
41
42if { ${delta_first} <= ${maxdelta} && ${delta_last} <= ${maxdelta} } {
43 puts "OCC311: OK"
44}
45
46set 2dviewer 0
47