1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00
ski 5747059b21 0026833: Create command checkview containing all viewer types
Created command checkview for displaying shapes.
2016-02-05 11:14:37 +03:00

48 lines
1.3 KiB
Plaintext
Executable File

puts "========"
puts "OCC311"
puts "========"
restore [locate_data_file OCC311.draw] c
#### checkshape c # - not a topological shape
set ufirst 1e-7
set ulast 6.2831854071795897
segment c ${ufirst} ${ulast}
set dumpc [dump c]
set list [split ${dumpc} "\n\t"]
set listLength [llength ${list}]
if { ${listLength} < 25 } {
puts "OCC311 - Error : listLength= ${listLength}"
}
regexp { +Degree +([-0-9.+eE]+), +([-0-9.+eE]+) +Poles, +([-0-9.+eE]+) +Knots} $dumpc full DegreeNumber PolesNumber KnotsNumber
set Knots [regexp -all -inline { +([-0-9.+eE]+ +: +[-0-9.+eE]+ +[-0-9.+eE]+)} $dumpc]
regexp { *[-0-9.+eE]+ +: +([-0-9.+eE]+) +[-0-9.+eE]+} [lindex $Knots 1] full FirstKnot
regexp { *[-0-9.+eE]+ +: +([-0-9.+eE]+) +[-0-9.+eE]+} [lindex $Knots [llength $Knots]-1] full LastKnot
set delta_first [expr abs(${FirstKnot} - ${ufirst}) / ${ufirst} * 100]
set delta_last [expr abs(${LastKnot} - ${ulast}) / ${ulast} * 100]
set maxdelta 0.01
puts "FirstKnot = ${FirstKnot}"
puts "LastKnot = ${LastKnot}"
if { ${delta_first} > ${maxdelta} } {
puts "OCC311 - Error : delta_first = ${delta_first}"
}
if { ${delta_last} > ${maxdelta} } {
puts "OCC311 - Error : delta_last = ${delta_last}"
}
if { ${delta_first} <= ${maxdelta} && ${delta_last} <= ${maxdelta} } {
puts "OCC311: OK"
}
checkview -display result -2d -path ${imagedir}/${test_image}.png