0027126: Create command checktrinfo to verify meshes
authorski <ski@opencascade.com>
Tue, 2 Feb 2016 14:14:15 +0000 (17:14 +0300)
committerabv <abv@opencascade.com>
Fri, 5 Feb 2016 08:14:44 +0000 (11:14 +0300)
Command checktrinfo was created.
Test cases were updated to use command checktrinfo.

108 files changed:
dox/dev_guides/tests/tests.md
src/DrawResources/CheckCommands.tcl
tests/bugs/demo/bug25445
tests/bugs/fclasses/bug26922
tests/bugs/heal/bug26244
tests/bugs/iges/buc60820_1
tests/bugs/iges/buc60820_2
tests/bugs/iges/buc60823
tests/bugs/iges/bug22888
tests/bugs/iges/bug306
tests/bugs/mesh/bug21593
tests/bugs/mesh/bug22778
tests/bugs/mesh/bug23105
tests/bugs/mesh/bug23106
tests/bugs/mesh/bug23614_1
tests/bugs/mesh/bug23614_2
tests/bugs/mesh/bug23614_3
tests/bugs/mesh/bug23614_4
tests/bugs/mesh/bug23631
tests/bugs/mesh/bug24127
tests/bugs/mesh/bug24775
tests/bugs/mesh/bug24938
tests/bugs/mesh/bug25157
tests/bugs/mesh/bug25281
tests/bugs/mesh/bug25519
tests/bugs/modalg_1/bug109
tests/bugs/modalg_1/bug179
tests/bugs/modalg_2/bug263
tests/bugs/modalg_2/bug264_0
tests/bugs/modalg_2/bug264_1
tests/bugs/modalg_2/bug264_10
tests/bugs/modalg_2/bug264_11
tests/bugs/modalg_2/bug264_12
tests/bugs/modalg_2/bug264_2
tests/bugs/modalg_2/bug264_3
tests/bugs/modalg_2/bug264_4
tests/bugs/modalg_2/bug264_5
tests/bugs/modalg_2/bug264_6
tests/bugs/modalg_2/bug264_7
tests/bugs/modalg_2/bug264_8
tests/bugs/modalg_2/bug264_9
tests/bugs/modalg_2/bug269_1
tests/bugs/modalg_2/bug269_2
tests/bugs/modalg_2/bug269_3
tests/bugs/modalg_2/bug269_4
tests/bugs/modalg_2/bug287
tests/bugs/modalg_2/bug291
tests/bugs/modalg_2/bug292
tests/bugs/modalg_2/bug347_1
tests/bugs/modalg_2/bug347_2
tests/bugs/modalg_2/bug358
tests/bugs/modalg_2/bug400
tests/bugs/modalg_2/bug481
tests/bugs/modalg_6/bug26897
tests/bugs/moddata_1/buc60707
tests/bugs/moddata_1/bug1416
tests/bugs/moddata_1/bug15
tests/bugs/moddata_1/bug15519
tests/bugs/moddata_1/bug16
tests/bugs/moddata_1/bug17
tests/bugs/moddata_1/bug20
tests/bugs/moddata_1/bug21121
tests/bugs/moddata_1/bug21122
tests/bugs/moddata_1/bug22759
tests/bugs/moddata_2/bug256
tests/bugs/moddata_2/bug258_1
tests/bugs/moddata_2/bug258_2
tests/bugs/moddata_2/bug428
tests/bugs/moddata_2/bug613_1
tests/bugs/moddata_2/bug613_2
tests/bugs/moddata_2/bug6412
tests/bugs/moddata_2/fra62476_1
tests/bugs/moddata_2/fra62476_2
tests/bugs/moddata_2/pro20333
tests/bugs/moddata_3/bug24959_1
tests/bugs/moddata_3/bug24959_2
tests/bugs/moddata_3/bug25179
tests/bugs/moddata_3/bug26359
tests/bugs/step/bug348_1
tests/bugs/step/bug348_2
tests/bugs/step/bug348_3
tests/bugs/step/bug348_4
tests/bugs/stlvrml/bug25050
tests/bugs/stlvrml/bug25279
tests/bugs/vis/buc60661
tests/bugs/vis/buc60858
tests/bugs/vis/bug19_1
tests/bugs/vis/bug19_2
tests/bugs/vis/bug20373
tests/bugs/vis/bug21578
tests/bugs/vis/bug22188
tests/bugs/vis/bug22304
tests/bugs/vis/bug22502
tests/bugs/vis/bug22652
tests/bugs/vis/bug22735
tests/bugs/vis/bug23200
tests/bugs/vis/bug288_1
tests/bugs/vis/bug288_2
tests/bugs/vis/bug288_3
tests/bugs/vis/bug288_4
tests/bugs/vis/bug288_5
tests/bugs/vis/bug316
tests/bugs/vis/bug319
tests/bugs/vis/bug331
tests/bugs/vis/bug344
tests/bugs/vis/bug364
tests/bugs/vis/bug4894
tests/bugs/xde/bug25357

index 3426c8a..476a233 100644 (file)
@@ -1331,3 +1331,62 @@ Allowed options are:
 checklength cp1 -l 7.278
 checklength res -l -equal ext_1
 ~~~~~
+@subsubsection testmanual_5_3_13 Check maximum deflection, number of triangles and nodes in mesh
+
+To check maximum deflection, number of nodes and triangles in mesh command *checktrinfo* can be used.
+
+Use: checktrinfo shapename [options...]
+
+Allowed options are:
+ * -tri [N]:  compare current number of triangles in "shapename" mesh with given reference data.
+      If reference value N is not given and current number of triangles is equal to 0
+      procedure checktrinfo will print an error.
+ * -nod [N]:  compare current number of nodes in "shapename" mesh with given reference data.
+      If reference value N is not givenand current number of nodes is equal to 0
+      procedure checktrinfo will print an error.
+ * -defl [N]: compare current value of maximum deflection in "shapename" mesh with given reference data
+      If reference value N is not given and current maximum deflection is equal to 0
+      procedure checktrinfo will print an error.
+ * -max_defl N:     compare current value of maximum deflection in "shapename" mesh with max possible value
+ * -tol_abs_tri N:  absolute tolerance for comparison of number of triangles (default value 0)
+ * -tol_rel_tri N:  relative tolerance for comparison of number of triangles (default value 0)
+ * -tol_abs_nod N:  absolute tolerance for comparison of number of nodes (default value 0)
+ * -tol_rel_nod N:  relative tolerance for comparison of number of nodes (default value 0)
+ * -tol_abs_defl N: absolute tolerance for deflection comparison (default value 0)
+ * -tol_rel_defl N: relative tolerance for deflection comparison (default value 0)
+ * -ref [trinfo a]: compare deflection, number of triangles and nodes in "shapename" and in "a"
+
+Note that options -tri, -nod, -defl do not work together with option -ref.
+
+Examples:
+
+comparison with some reference values
+~~~~~
+checktrinfo result -tri 129 -nod 131 -defl 0.01
+~~~~~
+
+comparison with another mesh
+~~~~~
+checktrinfo result -ref [tringo a]
+~~~~~
+
+comparison of deflection with max possible value
+~~~~~
+checktrinfo result -max_defl 1
+~~~~~
+
+to make sure that current values are not equal to zero
+~~~~~
+checktrinfo result -tri -nod -defl
+~~~~~
+
+to make sure that number of triangles and number of nodes are not equal to some specific values
+~~~~~
+checktrinfo result -tri !10 -nod !8
+~~~~~
+
+it is possible to compare current values with reference values with some tolerances.
+Use options -tol_\* for that.
+~~~~~
+checktrinfo result -defl 1 -tol_abs_defl 0.001
+~~~~~
index c08e88b..430ff14 100644 (file)
@@ -895,4 +895,121 @@ proc checkview {args} {
     }
     xwd ${PathToSave}
   }
-}
\ No newline at end of file
+
+}
+
+help checktrinfo {
+  Compare maximum deflection, number of nodes and triangles in "shape" mesh with given reference data
+
+  Use: checktrinfo shapename [options...]
+  Allowed options are:
+    -tri [N]:  compare current number of triangles in "shapename" mesh with given reference data.
+               If reference value N is not given and current number of triangles is equal to 0
+               procedure checktrinfo will print an error.
+    -nod [N]:  compare current number of nodes in "shapename" mesh with given reference data.
+               If reference value N is not givenand current number of nodes is equal to 0
+               procedure checktrinfo will print an error.
+    -defl [N]: compare current value of maximum deflection in "shapename" mesh with given reference data
+               If reference value N is not given and current maximum deflection is equal to 0
+               procedure checktrinfo will print an error.
+    -max_defl N:     compare current value of maximum deflection in "shapename" mesh with max possible value
+    -tol_abs_tri N:  absolute tolerance for comparison of number of triangles (default value 0)
+    -tol_rel_tri N:  relative tolerance for comparison of number of triangles (default value 0)
+    -tol_abs_nod N:  absolute tolerance for comparison of number of nodes (default value 0)
+    -tol_rel_nod N:  relative tolerance for comparison of number of nodes (default value 0)
+    -tol_abs_defl N: absolute tolerance for deflection comparison (default value 0)
+    -tol_rel_defl N: relative tolerance for deflection comparison (default value 0)
+    -ref [trinfo a]: compare deflection, number of triangles and nodes in "shapename" and in "a"
+}
+proc checktrinfo {shape args} {
+    puts "checktrinfo ${shape} ${args}"
+    upvar ${shape} ${shape}
+
+    if {![isdraw ${shape}] || [regexp "${shape} is a \n" [whatis ${shape}]]} {
+        puts "Error: The command cannot be built"
+        return
+    }
+
+    set ref_nb_triangles false
+    set ref_nb_nodes false
+    set ref_deflection false
+    set tol_abs_defl 0
+    set tol_rel_defl 0
+    set tol_abs_tri 0
+    set tol_rel_tri 0
+    set tol_abs_nod 0
+    set tol_rel_nod 0
+    set max_defl -1
+    set ref_info ""
+
+    set options {{"-tri" ref_nb_triangles ?}
+                 {"-nod" ref_nb_nodes ?}
+                 {"-defl" ref_deflection ?}
+                 {"-tol_abs_defl" tol_abs_defl 1}
+                 {"-tol_rel_defl" tol_rel_defl 1}
+                 {"-tol_abs_tri" tol_abs_tri 1}
+                 {"-tol_rel_tri" tol_rel_tri 1}
+                 {"-tol_abs_nod" tol_abs_nod 1}
+                 {"-tol_rel_nod" tol_rel_nod 1}
+                 {"-max_defl" max_defl 1}
+                 {"-ref" ref_info 1}}
+
+    _check_args ${args} ${options} "checktrinfo"
+
+    # get current number of triangles and nodes, value of max deflection
+    set tri_info [trinfo ${shape}]
+    set triinfo_pattern "(\[0-9\]+) +triangles.*\[^0-9]\(\[0-9\]+) +nodes.*deflection +(\[-0-9.+eE\]+)"
+    if {![regexp "${triinfo_pattern}" ${tri_info} dump cur_nb_triangles cur_nb_nodes cur_deflection]} {
+        puts "Error: command trinfo prints empty info"
+    }
+
+    # get reference values from -ref option
+    if { "${ref_info}" != ""} {
+        if {![regexp "${triinfo_pattern}" ${ref_info} dump ref_nb_triangles ref_nb_nodes ref_deflection]} {
+            puts "Error: reference information gived by -ref option is wrong"
+        }
+    }
+
+    # check number of triangles
+    if { [string is boolean ${ref_nb_triangles}] } {
+        if { ${cur_nb_triangles} <= 0 && ${ref_nb_triangles} } {
+            puts "Error: Number of triangles is equal to 0"
+        }
+    } else {
+        if {[regexp {!([-0-9.+eE]+)} $ref_nb_triangles full ref_nb_triangles_value]} {
+            if  {${ref_nb_triangles_value} == ${cur_nb_triangles} } {
+                puts "Error: Number of triangles is equal to ${ref_nb_triangles_value} but it should not"
+            }
+        } else {
+            checkreal "Number of triangles" ${cur_nb_triangles} ${ref_nb_triangles} ${tol_abs_tri} ${tol_rel_tri}
+        }
+    }
+
+    # check number of nodes
+    if { [string is boolean ${ref_nb_nodes}] } {
+        if { ${cur_nb_nodes} <= 0 && ${ref_nb_nodes} } {
+            puts "Error: Number of nodes is equal to 0"
+        }
+    } else {
+        if {[regexp {!([-0-9.+eE]+)} $ref_nb_nodes full ref_nb_nodes_value]} {
+            if  {${ref_nb_nodes_value} == ${cur_nb_nodes} } {
+                puts "Error: Number of nodes is equal to ${ref_nb_nodes_value} but it should not"
+            }
+        } else {
+            checkreal "Number of nodes" ${cur_nb_nodes} ${ref_nb_nodes} ${tol_abs_nod} ${tol_rel_nod}
+        }
+    }
+
+    # check deflection
+    if { [string is boolean ${ref_deflection}] } {
+        if { ${cur_deflection} <= 0 && ${ref_deflection} } {
+            puts "Error: Maximal deflection is equal to 0"
+        }
+    } else {
+        checkreal "Maximal deflection" ${cur_deflection} ${ref_deflection} ${tol_abs_defl} ${tol_rel_defl}
+    }
+
+    if { ${max_defl} != -1 && ${cur_deflection} > ${max_defl} } {
+        puts "Error: Maximal deflection is too big"
+    }
+}
index 36e80fa..a94072e 100644 (file)
@@ -10,19 +10,9 @@ pcone aCone 100 10 100
 
 tclean aCone
 incmesh aCone 0.01 -a 10.
-set bug_info [trinfo aCone]
-set NbTrian_1 [lindex $bug_info 3]
-set NbNodes_1 [lindex $bug_info 5]
+regexp {([0-9]+) +triangles.*[^0-9]([0-9]+) +nodes} [trinfo aCone] full NbTrian_1 NbNodes_1
 
 tclean aCone
 incmesh aCone 0.01 -a 1.
-set bug_info [trinfo aCone]
-set NbTrian_2 [lindex $bug_info 3]
-set NbNodes_2 [lindex $bug_info 5]
 
-if {$NbTrian_1 == $NbTrian_2} {
-  puts "ERROR: OCC25445 is not fixed. Number of triangles are equal for both meshes."
-}
-if {$NbNodes_1 == $NbNodes_2} {
-  puts "ERROR: OCC25445 is not fixed. Number of nodes are equal for both meshes."
-}
+checktrinfo aCone -tri !${NbTrian_1} -nod !${NbNodes_1}
index bd432ce..362712f 100755 (executable)
@@ -24,9 +24,7 @@ if { [regexp {Debug mode} [dversion]] } {
 
 psphere result 50.
 incmesh result 0.01
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full numTriangles
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full numNodes
+trinfo result
 
 set time_info [time {writevrml result ${imagedir}/bug26922.wrl 2 2}]
 regexp {([-0-9.+eE]+)} ${time_info} full time_performance
index 6a4e139..e2bef96 100644 (file)
@@ -268,16 +268,7 @@ unifysamedom r res
 incmesh r 0.1
 trinfo r
 
-set info [trinfo r]
-regexp { +([-0-9.+eE]+) +triangles} $info full tr
-regexp { +([-0-9.+eE]+) +nodes} $info full nd
-regexp { +([-0-9.+eE]+) +nodes} $info full nd
-regexp {Maximal deflection +([-0-9.+eE]+)} $info full defl
-
-set expected_defl 0.04
-set tol_abs_defl 0.01
-set tol_rel_defl 0.01
-checkreal "Maximal deflection" ${defl} ${expected_defl} ${tol_abs_defl} ${tol_rel_defl}
+checktrinfo r -defl 0.04 -tol_abs_defl 0.01 -tol_rel_defl 0.01
 
 vinit
 vsetdispmode 1
index 92b5d95..d71a4cd 100755 (executable)
@@ -11,12 +11,6 @@ checkshape result r
 tclean result
 incmesh result 0.1
 triangles result
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri <= 0 || $nod <= 0 } {
-    puts "Error : Problems with shading"
-}
 
+checktrinfo result -tri -nod
 checkview -display result -2d -path ${imagedir}/${test_image}.png
index 2d7cfa8..0ba462a 100755 (executable)
@@ -13,14 +13,6 @@ vdisplay result
 vsetdispmode result 1
 vfit
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nod} $info full nod
-
-
-if { $tri != 1655 || $nod != 1143 } {
-    puts "Shading problem may be, nb tri & nod were changed"
-}
+checktrinfo result -tri 578 -nod 502
 
 checkview -display result -2d -path ${imagedir}/${test_image}.png
-
index dd85bbc..1b4856d 100755 (executable)
@@ -14,13 +14,6 @@ vdisplay result
 vsetdispmode result 1
 vfit
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri != 17618 || $nod != 11153 } {
-    puts "Shading problem may be, nb tri & nod are changed"
-}
+checktrinfo result -tri 15571 -nod 9024
 
 checkview -display result -2d -path ${imagedir}/${test_image}.png
-
index ee15fa9..391d202 100755 (executable)
@@ -22,12 +22,11 @@ vdisplay a_1
 vfit
 vzfit
 tclean a_1
-set inf_before [trinfo a_1]
+trinfo a_1
 
 vsetdispmode a_1 1
-set inf_after [trinfo a_1]
-regexp { +([-0-9.+eE]+) +triangles} $inf_after full tri_after
-regexp { +([-0-9.+eE]+) +nodes} $inf_after full nod_after
+
+checktrinfo a_1 -tri -nod
 
 set color [vreadpixel ${x1} ${y1} rgb]
 set rd [lindex $color 0]
@@ -38,21 +37,4 @@ if { $rd == 0 || $gr == 0 || $bl == 0 } {
     puts "Error : Face is not shaded (colors are not equal)"
 }
 
-if { $tri_after <= 0 || $nod_after <= 0 } {
-    puts "Error : Face is not shaded (number of nodes or triangles is wrong)"
-}
-
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
-
-
-
-
-
-
-
-
-
-
-
-
-
index f046916..c7988d6 100755 (executable)
@@ -20,13 +20,7 @@ vsetdispmode result 1
 vdisplay result
 vfit
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { ($tri != 6409 || $nod != 6195) } {
-    puts "Shading problem may be, nb tri & nod"
-} 
+checktrinfo result -tri 19206 -nod 12547
 
 checkmaxtol result -ref 0.92213088179312575
 checknbshapes result -shell 1
index 5387bdf..f1c8149 100644 (file)
@@ -7,35 +7,11 @@ restore [locate_data_file bug21593_internal_vertices.brep] a
 # enable internal vertices mode
 tclean a
 incmesh a 0.1
-set trinfo_a [trinfo a]
-regexp {([0-9]+) triangles} $trinfo_a str nbtriangles_a
-regexp {([0-9]+) nodes} $trinfo_a str nbnodes_a
-
-# check triangles
-if { $nbtriangles_a != 10 } {
-    puts "Error: incorrect number of triangles in case of internal vertices mode is ON ($nbtriangles_a)"
-}
-
-# check nodes
-if { $nbnodes_a != 8 } {
-    puts "Error: incorrect number of nodes in case of internal vertices mode is ON ($nbnodes_a)"
-}
 
+checktrinfo a -tri 10 -nod 8
 
 # disable internal vertices mode
 tclean a
 incmesh a 0.1 -int_vert_off
-set trinfo_a [trinfo a]
-regexp {([0-9]+) triangles} $trinfo_a str nbtriangles_a
-regexp {([0-9]+) nodes} $trinfo_a str nbnodes_a
-
-# check triangles
-if { $nbtriangles_a != 2 } {
-    puts "Error: incorrect number of triangles in case of internal vertices mode is OFF ($nbtriangles_a)"
-}
-
-# check nodes
-if { $nbnodes_a != 4 } {
-    puts "Error: incorrect number of nodes in case of internal vertices mode is OFF ($nbnodes_a)"
-}
 
+checktrinfo a -tri 2 -nod 4
index c247e25..e85c70f 100644 (file)
@@ -36,8 +36,4 @@ if { $nbtri_r > [expr 2. * $nbtri_s] } {
 # extra check: deflection on rough mesh on NURBS
 tclean r
 incmesh r 0.1
-set trinfo_r_01 [trinfo r]
-regexp {deflection ([0-9.+e-]+)} $trinfo_r_01 str defl_r_01
-if { $defl_r_01 > 0.1 } {
-    puts "Error: too big deflection on NURBS face ($defl_r > 0.1)"
-}
+checktrinfo r -max_defl 0.1
index f93ece9..6855405 100755 (executable)
@@ -10,16 +10,4 @@ restore [locate_data_file bug23105_f372.brep] result
 checkshape result
 
 incmesh result 0.1
-set trinfo_s [trinfo result]
-regexp {([0-9]+) triangles} $trinfo_s str nbtri_s
-regexp {deflection ([0-9.+e-]+)} $trinfo_s str defl_s
-
-# check deflections
-if { $defl_s > 0.1 } {
-    puts "Error: too big deflection ($defl_s > 0.1)"
-}
-
-# compare number of triangles
-if { $nbtri_s == 0 } {
-    puts "Error: shape contains 0 triangles"
-}
+checktrinfo result -tri -max_defl 0.1
index 58a0843..8ec2f86 100755 (executable)
@@ -13,17 +13,5 @@ restore [locate_data_file bug23106_face_0triangles.brep] result
 incmesh result 0.01
 triangles result 
 
-set tri 0
-set nod 0
-
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { ${tri} > 0 && ${nod} > 0 } {
-    puts "${BugNumber} shading: OK"
-} else {
-    puts "${BugNumber} shading: Faulty"
-}
-
+checktrinfo result -tri -nod
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index b99fead..6c1cf19 100644 (file)
@@ -9,27 +9,10 @@ puts ""
 restore [locate_data_file bug23614_face1.brep] f1
 tclean f1
 incmesh f1 0.01
-set info [trinfo f1]
-regexp {([0-9]+) triangles} $info full tri
-regexp {([0-9]+) nodes} $info full nod
 
-# compare number of triangles
-if { $tri == 0 } {
-    puts "Error: face contains $tri triangles"
-} else {
-    puts "OK: face contains $tri triangles"
-}
-
-# compare number of nodes
-if { $nod == 0 } {
-    puts "Error : face contains $nod nodes"
-} else {
-    puts "OK: face contains $nod nodes"
-}
+checktrinfo f1 -tri -nod
 
 top
 fit
 triangles f1
 checkview -screenshot -2d -path ${imagedir}/${test_image}.png
-
-
index 3005ce6..7b9f010 100644 (file)
@@ -9,27 +9,10 @@ puts ""
 restore [locate_data_file bug23614_face2.brep] f2
 tclean f2
 incmesh f2 0.01
-set info [trinfo f2]
-regexp {([0-9]+) triangles} $info full tri
-regexp {([0-9]+) nodes} $info full nod
 
-# compare number of triangles
-if { $tri == 0 } {
-    puts "Error: face contains $tri triangles"
-} else {
-    puts "OK: face contains $tri triangles"
-}
-
-# compare number of nodes
-if { $nod == 0 } {
-    puts "Error : face contains $nod nodes"
-} else {
-    puts "OK: face contains $nod nodes"
-}
+checktrinfo f2 -tri -nod
 
 top
 fit
 triangles f2
 checkview -screenshot -2d -path ${imagedir}/${test_image}.png
-
-
index 516ddf2..879ccae 100644 (file)
@@ -9,27 +9,10 @@ puts ""
 restore [locate_data_file bug23614_face3.brep] f3
 tclean f3
 incmesh f3 0.01
-set info [trinfo f3]
-regexp {([0-9]+) triangles} $info full tri
-regexp {([0-9]+) nodes} $info full nod
 
-# compare number of triangles
-if { $tri == 0 } {
-    puts "Error: face contains $tri triangles"
-} else {
-    puts "OK: face contains $tri triangles"
-}
-
-# compare number of nodes
-if { $nod == 0 } {
-    puts "Error : face contains $nod nodes"
-} else {
-    puts "OK: face contains $nod nodes"
-}
+checktrinfo f3 -tri -nod
 
 top
 fit
 triangles f3
 checkview -screenshot -2d -path ${imagedir}/${test_image}.png
-
-
index b15aa59..97b152b 100644 (file)
@@ -9,27 +9,10 @@ puts ""
 restore [locate_data_file bug23614_face4.brep] f4
 tclean f4
 incmesh f4 0.01
-set info [trinfo f4]
-regexp {([0-9]+) triangles} $info full tri
-regexp {([0-9]+) nodes} $info full nod
 
-# compare number of triangles
-if { $tri == 0 } {
-    puts "Error: face contains $tri triangles"
-} else {
-    puts "OK: face contains $tri triangles"
-}
-
-# compare number of nodes
-if { $nod == 0 } {
-    puts "Error : face contains $nod nodes"
-} else {
-    puts "OK: face contains $nod nodes"
-}
+checktrinfo f4 -tri -nod
 
 top
 fit
 triangles f4
 checkview -screenshot -2d -path ${imagedir}/${test_image}.png
-
-
index d30e52e..3ab080d 100644 (file)
@@ -13,25 +13,10 @@ restore [locate_data_file OCC396_f2903.brep] result
 incmesh result 0.01
 triangles result 
 
-set tri 0
-set nod 0
-
-set good_tri 38
-set good_nod 40
-
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { ${tri} == ${good_tri} && ${nod} == ${good_nod} } {
-    puts "Bug ${BugNumber} shading: OK"
-} else {
-    puts "Bug ${BugNumber} shading: Faulty"
-}
+checktrinfo result -tri 38 -nod 40
 
 vinit
 vdisplay result
 vfit
 vsetdispmode 1
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
-
index 5308559..0a8ef0e 100755 (executable)
@@ -14,23 +14,7 @@ incmesh f 1
 
 trinfo f
 
-set trinfo_s [trinfo f]
-regexp {([0-9]+) triangles} ${trinfo_s} str nbtri_s
-regexp {([0-9]+) nodes} ${trinfo_s} str nbnod_s
-regexp {deflection ([0-9.+e-]+)} ${trinfo_s} str defl_s
-
-if { ${nbtri_s} != 99 } {
-   puts "Error: triangle number is bad"
-}
-
-if { ${nbnod_s} != 59 } {
-   puts "Error: node number is bad"
-}
-
-set expected_defl_s 0.59663444648536146
-set tol_abs_defl_s 1.e-3
-set tol_rel_defl_s 0.01
-checkreal "Deflection" ${defl_s} ${expected_defl_s} ${tol_abs_defl_s} ${tol_rel_defl_s}
+checktrinfo f -tri 99 -nod 59 -defl 0.59663444648536146 -tol_abs_defl 1.e-3 -tol_rel_defl 0.01
 
 vinit
 vdisplay f
index d6f888d..69c3571 100755 (executable)
@@ -11,25 +11,5 @@ vinit
 vdisplay face
 vfit
 
-set trinfo_s [trinfo face]
-regexp {([0-9]+) triangles} ${trinfo_s} str nbtri_s
-regexp {([0-9]+) nodes} ${trinfo_s} str nbnod_s
-regexp {deflection ([0-9.+e-]+)} ${trinfo_s} str defl_s
-
-if { ${nbtri_s} == 0 } {
-   puts "Error: shape contains 0 triangles"
-} else {
-   puts "OK: shape contains triangles"
-}
-
-if { ${nbnod_s} == 0 } {
-   puts "Error: shape contains 0 nodes"
-} else {
-   puts "OK: shape contains nodes"
-}
-
-if { ${defl_s} == 0 } {
-   puts "Error: deflection is 0"
-} else {
-   puts "OK: deflection is good"
-}
+checktrinfo face -tri -nod -defl
+checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index e5d07e5..c1fb88e 100644 (file)
@@ -1,5 +1,5 @@
-puts "TODO OCC24938 ALL: Error: shape contains 0 triangles"
-puts "TODO OCC24938 ALL: Error: shape contains 0 nodes"
+puts "TODO OCC24938 ALL: Error: Number of triangles is equal to 0"
+puts "TODO OCC24938 ALL: Error: Number of nodes is equal to 0"
 
 puts "=========="
 puts "OCC24938"
@@ -16,21 +16,8 @@ restore [locate_data_file bug24938_27773.brep] result
 
 tclean result
 incmesh result 1.5 -relative
-set trinfo_s [trinfo result]
-regexp {([0-9]+) triangles} ${trinfo_s} str nbtri_s
-regexp {([0-9]+) nodes} ${trinfo_s} str nbnod_s
 
-if { ${nbtri_s} == 0 } {
-  puts "Error: shape contains 0 triangles"
-} else {
-  puts "OK: shape contains ${nbtri_s} triangles"
-}
-
-if { ${nbnod_s} == 0 } {
-  puts "Error: shape contains 0 nodes"
-} else {
-  puts "OK: shape contains ${nbnod_s} nodes"
-}
+checktrinfo result -tri -nod
 
 vinit
 vsetdispmode 1
index c47379a..0d3d691 100644 (file)
@@ -15,21 +15,8 @@ bcut Cut Cone Cylinder
 explode Cut F
 tclean Cut_1
 incmesh Cut_1 0.1
-set trinfo_s [trinfo Cut_1]
-regexp {([0-9]+) triangles} ${trinfo_s} str nbtri_s
-regexp {([0-9]+) nodes} ${trinfo_s} str nbnod_s
 
-if { ${nbtri_s} == 0 } {
-   puts "Error: shape contains 0 triangles"
-} else {
-   puts "OK: shape contains ${nbtri_s} triangles"
-}
-
-if { ${nbnod_s} == 0 } {
-   puts "Error: shape contains 0 nodes"
-} else {
-   puts "OK: shape contains ${nbnod_s} nodes"
-}
+checktrinfo Cut_1 -tri -nod
 
 vinit
 vdisplay Cut_1
index 791b462..6a02314 100644 (file)
@@ -11,21 +11,8 @@ pload XDE
 param xstep.cascade.unit M
 stepread [locate_data_file bug25281_tess_infloop_extract.step] a *
 incmesh a_1 0.0002 1
-set trinfo_s [trinfo a_1]
-regexp {([0-9]+) triangles} ${trinfo_s} str nbtri_s
-regexp {([0-9]+) nodes} ${trinfo_s} str nbnod_s
 
-if { ${nbtri_s} == 0 } {
-   puts "Error: shape contains 0 triangles"
-} else {
-   puts "OK: shape contains ${nbtri_s} triangles"
-}
-
-if { ${nbnod_s} == 0 } {
-   puts "Error: shape contains 0 nodes"
-} else {
-   puts "OK: shape contains ${nbnod_s} nodes"
-}
+checktrinfo a_1 -tri -nod
 
 vinit
 vdisplay a_1
index 04517cf..05f5b14 100755 (executable)
@@ -15,31 +15,5 @@ fit
 isos a 0
 triangles a
 
-set trinfo_s [trinfo a]
-regexp {([0-9]+) triangles} ${trinfo_s} str nbtri_s
-regexp {([0-9]+) nodes} ${trinfo_s} str nbnod_s
-regexp {deflection ([0-9.+e-]+)} ${trinfo_s} str defl_s
-
-set good_nbtri 2721
-set good_nbnod 1405
-set good_defl 0.044436924588798624
-
-set good_percent 5
-
-set nbtri_percent [expr abs (${good_nbtri} - ${nbtri_s}) / double (${nbtri_s}) * 100 ]
-set nbnod_percent [expr abs (${good_nbnod} - ${nbnod_s}) / double (${nbnod_s}) * 100 ]
-set defl_percent  [expr abs (${good_defl} - ${defl_s}) / ${defl_s} * 100 ]
-
-if { ${nbtri_percent} > ${good_percent} } {
-  puts "Error: triangle number is bad, it has changed to ${nbtri_percent} %"
-}
-
-if { ${nbnod_percent} > ${good_percent} } {
-  puts "Error: node number is bad, it has changed to ${nbnod_percent} %"
-}
-
-if { ${defl_percent} > ${good_percent} } {
-  puts "Error: deflection is bad, it has changed to ${defl_percent} %"
-}
-
+checktrinfo a -tri 2721 -nod 1405 -defl 0.044436924588798624 -tol_rel_defl 0.05 -tol_rel_tri 0.05 -tol_rel_nod 0.05
 checkview -screenshot -2d -path ${imagedir}/${test_image}.png
index 2c75701..38f83e7 100755 (executable)
@@ -1,4 +1,5 @@
-puts "TODO OCC12345 ALL: Faulty BUC61057: here can be shading problem"
+puts "TODO OCC12345 ALL: Error: Number of triangles"
+puts "TODO OCC12345 ALL: Error: Number of nodes"
 
 puts "================"
 puts "BUC61057"
@@ -19,16 +20,6 @@ vdisplay result
 vsetdispmode result 1
 vfit
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri != 294 && $nod != 300 }  {
-    puts "Faulty BUC61057: here can be shading problem"
-} else {
-    puts "Shading of BUC61057 is OK"
-}
-
+checktrinfo result -tri 294 -nod 300
 checkprops result -s 33.8757 
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
-
index a70436b..4e9d33c 100755 (executable)
@@ -17,16 +17,7 @@ triangles result
 set tri 0
 set nod 0
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri == 1874 || $nod == 1861} {
-    puts " OCC179  shading: OK"
-} else {
-    puts " OCC179  shading: Faulty"
-}
-
+checktrinfo result -tri 1874 -nod 1861
 checkprops result -s 12229.8 
 checkshape result
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index cea2cdf..729b1d9 100755 (executable)
@@ -1,5 +1,6 @@
-puts "TODO OCC11111 ALL: Faulty OCC263: here is shading problem"
 puts "TODO OCC11111 ALL: Error : The area of result shape is"
+puts "TODO OCC11111 ALL: Error: Number of triangles"
+puts "TODO OCC11111 ALL: Error: Number of nodes"
 
 puts "========"
 puts "OCC263"
@@ -16,16 +17,7 @@ incmesh result 0.01
 #View the result of mesh
 triangles result
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri != 989 && $nod != 535 }  {
-    puts "Faulty OCC263: here is shading problem"
-} else {
-    puts "Shading of OCC263  is OK"
-}
-
+checktrinfo result -tri 989 -nod 535
 checkprops result -s 0 
 checkshape result
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index 1e587a7..f150faa 100755 (executable)
@@ -15,15 +15,6 @@ vclear
 isos result 0
 triangles result
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri != 6 && $nod != 8 }  {
-    puts "Faulty OCC264_0: here is shading problem"
-} else {
-    puts "Shading of OCC264_0 is OK"
-}
-
+checktrinfo result -tri 6 -nod 8
 checkprops result -s 1.3135 
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index b0a1a2d..dcc42d2 100755 (executable)
@@ -1,5 +1,6 @@
-puts "TODO OCC12345 ALL: Faulty OCC264_1: here is shading problem"
 puts "TODO OCC12345 ALL: Error : The area of result shape is"
+puts "TODO OCC12345 ALL: Error: Number of triangles"
+puts "TODO OCC12345 ALL: Error: Number of nodes"
 
 puts "========"
 puts "OCC264"
@@ -17,15 +18,6 @@ vclear
 isos result 0
 triangles result
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri != 26 && $nod != 28 }  {
-    puts "Faulty OCC264_1: here is shading problem"
-} else {
-    puts "Shading of OCC264_1 is OK"
-}
-
+checktrinfo result -tri 26 -nod 28
 checkprops result -s 0 
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index 60e4f39..e536218 100755 (executable)
@@ -1,4 +1,5 @@
-puts "TODO OCC12345 ALL: Faulty OCC264_10: here is shading problem"
+puts "TODO OCC12345 ALL: Error: Number of triangles"
+puts "TODO OCC12345 ALL: Error: Number of nodes"
 puts "TODO OCC12345 ALL: Error : The area of result shape is"
 
 puts "========"
@@ -17,15 +18,6 @@ vclear
 isos result 0
 triangles result
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri != 8 && $nod != 10 }  {
-    puts "Faulty OCC264_10: here is shading problem"
-} else {
-    puts "Shading of OCC264_10 is OK"
-}
-
+checktrinfo result -tri 8 -nod 10
 checkprops result -s 0 
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index 31feee3..a231911 100755 (executable)
@@ -1,4 +1,5 @@
-puts "TODO OCC12345 ALL: Faulty OCC264_11: here is shading problem"
+puts "TODO OCC12345 ALL: Error: Number of triangles"
+puts "TODO OCC12345 ALL: Error: Number of nodes"
 puts "TODO OCC12345 ALL: Error : The area of result shape is"
 
 puts "========"
@@ -17,15 +18,6 @@ vclear
 isos result 0
 triangles result
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri != 32 && $nod != 28 }  {
-    puts "Faulty OCC264_11: here is shading problem"
-} else {
-    puts "Shading of OCC264_11 is OK"
-}
-
+checktrinfo result -tri 32 -nod 28
 checkprops result -s 0 
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index 7315871..dc2e857 100755 (executable)
@@ -1,4 +1,5 @@
-puts "TODO OCC11111 ALL: Faulty OCC264_12: here is shading problem"
+puts "TODO OCC12345 ALL: Error: Number of triangles"
+puts "TODO OCC12345 ALL: Error: Number of nodes"
 puts "TODO OCC11111 ALL: Error : The area of result shape is"
 
 puts "========"
@@ -16,19 +17,7 @@ vclear
 isos res 0
 triangles result
 
-#smallview
-#fit
-
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri != 19 && $nod != 21 }  {
-    puts "Faulty OCC264_12: here is shading problem"
-} else {
-    puts "Shading of OCC264_12 is OK"
-}
-
+checktrinfo result -tri 19 -nod 21
 checkprops result -s 0 
 checkshape result
 checkview -display result -2d -path ${imagedir}/${test_image}.png
index 4f75592..e26f08b 100755 (executable)
@@ -1,4 +1,5 @@
-puts "TODO OCC12345 ALL: Faulty OCC264_2: here is shading problem"
+puts "TODO OCC12345 ALL: Error: Number of triangles"
+puts "TODO OCC12345 ALL: Error: Number of nodes"
 puts "TODO OCC12345 ALL: Error : The area of result shape is"
 
 puts "========"
@@ -17,18 +18,6 @@ vclear
 isos result 0
 triangles result
 
-smallview
-fit
-
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri != 10 && $nod != 12 }  {
-    puts "Faulty OCC264_2: here is shading problem"
-} else {
-    puts "Shading of OCC264_2 is OK"
-}
-
+checktrinfo result -tri 10 -nod 12
 checkprops result -s 0 
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index 7408eb3..1d11b57 100755 (executable)
@@ -1,4 +1,5 @@
-puts "TODO OCC12345 ALL: Faulty OCC264_3: here is shading problem"
+puts "TODO OCC12345 ALL: Error: Number of triangles"
+puts "TODO OCC12345 ALL: Error: Number of nodes"
 puts "TODO OCC12345 ALL: Error : The area of result shape is"
 
 puts "========"
@@ -17,18 +18,6 @@ vclear
 isos result 0
 triangles result
 
-#smallview
-#fit
-
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri != 13 && $nod != 15 }  {
-    puts "Faulty OCC264_3: here is shading problem"
-} else {
-    puts "Shading of OCC264_3 is OK"
-}
-
+checktrinfo result -tri 13 -nod 15
 checkprops result -s 0 
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index fccca89..bf66b2a 100755 (executable)
@@ -1,4 +1,5 @@
-puts "TODO OCC12345 ALL: Faulty OCC264_4: here is shading problem"
+puts "TODO OCC12345 ALL: Error: Number of triangles"
+puts "TODO OCC12345 ALL: Error: Number of nodes"
 puts "TODO OCC12345 ALL: Error : The area of result shape is"
 
 puts "========"
@@ -17,18 +18,6 @@ vclear
 isos result 0
 triangles result
 
-#smallview
-#fit
-
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri != 13 && $nod != 15 }  {
-    puts "Faulty OCC264_4: here is shading problem"
-} else {
-    puts "Shading of OCC264_4 is OK"
-}
-
+checktrinfo result -tri 13 -nod 15
 checkprops result -s 0 
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index 093e454..ac6afab 100755 (executable)
@@ -1,4 +1,5 @@
-puts "TODO OCC12345 ALL: Faulty OCC264_5: here is shading problem"
+puts "TODO OCC12345 ALL: Error: Number of triangles"
+puts "TODO OCC12345 ALL: Error: Number of nodes"
 puts "TODO OCC12345 ALL: Error : The area of result shape is"
 
 puts "========"
@@ -17,18 +18,6 @@ vclear
 isos result 0
 triangles result
 
-#smallview
-#fit
-
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri != 85 && $nod != 87 }  {
-    puts "Faulty OCC264_5: here is shading problem"
-} else {
-    puts "Shading of OCC264_5 is OK"
-}
-
+checktrinfo result -tri 85 -nod 87
 checkprops result -s 0 
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index ca9cad6..5285e22 100755 (executable)
@@ -15,18 +15,6 @@ vclear
 isos result 0
 triangles result
 
-#smallview
-#fit
-
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri != 18 && $nod != 20 }  {
-    puts "Faulty OCC264_6: here is shading problem"
-} else {
-    puts "Shading of OCC264_6 is OK"
-}
-
+checktrinfo result -tri 18 -nod 20
 checkprops result -s 19.2399 
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index e0211e1..8cb01cd 100755 (executable)
@@ -15,18 +15,6 @@ vclear
 isos result 0
 triangles result
 
-#smallview
-#fit
-
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { ($tri != 114 && $nod != 116) && ($tri != 116 && $nod != 118) }  {
-    puts "Shady OCC264_7: here may be shading problem"
-} else {
-    puts "Shading of OCC264_7 is OK"
-}
-
+checktrinfo result -tri 98 -nod 100
 checkprops result -s 150.283 
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index 3810099..c67744f 100755 (executable)
@@ -1,4 +1,5 @@
-puts "TODO OCC12345 ALL: Faulty OCC264_8: here is shading problem"
+puts "TODO OCC12345 ALL: Error: Number of triangles"
+puts "TODO OCC12345 ALL: Error: Number of nodes"
 puts "TODO OCC12345 ALL: Error : The area of result shape is"
 
 puts "========"
@@ -17,18 +18,6 @@ vclear
 isos result 0
 triangles result
 
-#smallview
-#fit
-
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri != 19 && $nod != 21 }  {
-    puts "Faulty OCC264_8: here is shading problem"
-} else {
-    puts "Shading of OCC264_8 is OK"
-}
-
+checktrinfo result -tri 19 -nod 21
 checkprops result -s 0 
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index 8e6cba1..714af63 100755 (executable)
@@ -1,4 +1,5 @@
-puts "TODO OCC12345 ALL: Faulty OCC264_9: here is shading problem"
+puts "TODO OCC12345 ALL: Error: Number of triangles"
+puts "TODO OCC12345 ALL: Error: Number of nodes"
 puts "TODO OCC12345 ALL: Error : The area of result shape is"
 
 puts "========"
@@ -17,18 +18,6 @@ vclear
 isos result 0
 triangles result
 
-#smallview
-#fit
-
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri != 19 && $nod != 21 }  {
-    puts "Faulty OCC264_9: here is shading problem"
-} else {
-    puts "Shading of OCC264_9 is OK"
-}
-
+checktrinfo result -tri 19 -nod 21
 checkprops result -s 0 
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index c024971..8b0ebed 100755 (executable)
@@ -12,16 +12,7 @@ incmesh result 0.01
 #View the result of mesh
 triangles result
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-#$tri != 8091 && $nod != 4121,aki251103
-if { $tri != 5853 && $nod !=  2999 }  {
-  puts "Shady OCC269: shading problem may be, nb tri & nod changed"
-} else {
-  puts "Shading of OCC269 is OK"
-}
+checktrinfo result -tri 3657 -nod 1908
 checkprops result -s 32.9479 
 checkshape result
 checkview -display result -2d -path ${imagedir}/${test_image}.png
index 9e9dda1..e63cb19 100755 (executable)
@@ -12,16 +12,7 @@ incmesh result 0.01
 #View the result of mesh
 triangles result
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-# $tri != 7627 && $nod != 3888,aki251103
-if { $tri != 6849 && $nod !=  3498 }  {
-  puts "Shady OCC269: shading problem may be"
-} else {
-  puts "Shading of OCC269 is OK"
-}
+checktrinfo result -tri 3991 -nod 2076
 checkprops result -s 32.9479 
 checkshape result
 checkview -display result -2d -path ${imagedir}/${test_image}.png
index 6e8fe31..0527204 100755 (executable)
@@ -12,16 +12,7 @@ incmesh result 0.01
 #View the result of mesh
 triangles result
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-# $tri != 7524 && $nod != 3840,aki251103
-if { $tri != 6302 && $nod !=   3226 }  {
-  puts "Shady OCC269: shading problem may be, nb tri & nod changed"
-} else {
-  puts "Shading of OCC269 is OK"
-}
+checktrinfo result -tri 3737 -nod 1952
 checkprops result -s 36.4284 
 checkshape result
 checkview -display result -2d -path ${imagedir}/${test_image}.png
index 919b892..003b7b2 100755 (executable)
@@ -12,16 +12,7 @@ incmesh result 0.01
 #View the result of mesh
 triangles result
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-# $tri != 8362 && $nod != 4257
-if { $tri != 7218 && $nod !=  3685 }  {
-  puts "Shady OCC269: shading problem may be, nb tri & nod changed"
-} else {
-  puts "Shading of OCC269 is OK"
-}
+checktrinfo result -tri 4039 -nod 2104
 checkprops result -s 36.4284 
 checkshape result
 checkview -display result -2d -path ${imagedir}/${test_image}.png
index d13d80b..a78f4f0 100755 (executable)
@@ -1,5 +1,6 @@
 puts "TODO OCC12345 ALL: Error : The area of result shape is"
-puts "TODO OCC12345 ALL: OCC287 : Faulty"
+puts "TODO OCC12345 ALL: Error: Number of triangles"
+puts "TODO OCC12345 ALL: Error: Number of nodes"
 
 puts "========================"
 puts " OCC287 "
@@ -13,26 +14,7 @@ isos result 0
 incmesh result .1
 triangles result
 
-set tri 0
-set nod 0
-
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri != 604 && $nod != 363} {
-    puts " Warning:  OCC287  looks like OK, but visual checking is required !!!!"
-} else {
-    puts "OCC287 : Faulty"
-}
-
-puts ""
-puts "Besides, it is impossible to load this shape in 3D Viewer"
-vinit
-vdisplay result
-vfit
-vsetdispmode result 1
-
+checktrinfo result -tri !604 -nod !363
 checkprops result -s 0 
 checkshape result
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index d9ed03d..f8e3250 100755 (executable)
@@ -17,19 +17,6 @@ vfit
 isos result 0
 triangles result
 
-      set tri 0
-      set nod 0
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-#$tri == 395 && $nod == 350,aki251103.
-if { $tri == 382 && $nod == 343 } {
-       puts " Warning:  OCC291  looks like OK, but visual checking is required !"
-} else {
-       puts " Shady OCC291 : nb tri & nod changed"
-}
-
+checktrinfo result -tri 1135 -nod 823
 checkprops result -s 376.873 
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
-
index af727fa..0a0b88b 100755 (executable)
@@ -19,16 +19,6 @@ vsetdispmode result 1
 isos result 0
 triangles result
 
-      set tri 0
-      set nod 0
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-if { $tri ==6 && $nod == 8} {
-    puts " Warning:  OCC292  looks like OK, but visual checking is required !!!!"
-} else {
-    puts " OCC292 : Faulty"
-}
-
+checktrinfo result -tri 6 -nod 8
 checkprops result -s 1.3135 
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index bad56fe..33d7eac 100755 (executable)
@@ -14,17 +14,6 @@ vdisplay result
 vfit
 vsetdispmode result 1
 
-set tri 0
-set nod 0
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri == 72 && $nod == 74} {
-    puts " OCC347  case 1: OK"
-} else {
-    puts " OCC347  case 1: Faulty"
-}
-
+checktrinfo result -tri 72 -nod 74
 checkprops result -s 314.159 
 checkview -display result -2d -path ${imagedir}/${test_image}.png
index 83de5bb..d21fc5b 100755 (executable)
@@ -14,18 +14,7 @@ vdisplay result
 vfit
 vsetdispmode result 1
 
-set tri 0
-set nod 0
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri == 71 && $nod == 73} {
-       puts " OCC347  case 2: OK"
-} else {
-       puts " OCC347  case 2: Faulty"
-}
-
+checktrinfo result -tri 71 -nod 73
 checkprops result -s 100.531 
 checkview -display result -2d -path ${imagedir}/${test_image}.png
 
index 667796a..256f561 100755 (executable)
@@ -18,24 +18,8 @@ vinit
 vdisplay result
 vfit
 vsetdispmode result 1
-# checkshape res
-# maxtolerance res
-
-set tri 0
-set nod 0
-
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri == 12966 && $nod == 6896} {
-    puts " OCC358  looks like OK"
-} else {
-    puts [format " tri= %s  nod= %s " $tri $nod]
-    puts " OCC358  : Shady (bad shading)"
-}
 
+checktrinfo result -tri 34146 -nod 17507
 checkprops result -s 24861.2 
 checkshape result
 checkview -display result -2d -path ${imagedir}/${test_image}.png
-
index ded7e06..15fc063 100755 (executable)
@@ -1,4 +1,5 @@
-puts "TODO OCC11111 ALL: OCC358 : Faulty"
+puts "TODO OCC11111 ALL: Error: Number of triangles"
+puts "TODO OCC11111 ALL: Error: Number of nodes"
 puts "TODO OCC11111 ALL: Error : The area of result shape is"
 
 puts "========================"
@@ -15,16 +16,7 @@ vdisplay result
 vfit
 vsetdispmode result 1
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri == 66 && $nod ==70} {
-    puts " Warning:  OCC358  looks like OK, but visual checking is required !!!!"
-} else {
-    puts "OCC358 : Faulty , but visual checking is required !!!!"
-}
-
+checktrinfo result -tri 66 -nod 70
 checkprops result -s 0 
 checkshape result
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 6dc0c33..c598c82 100755 (executable)
@@ -16,18 +16,6 @@ vdisplay result
 vfit
 vsetdispmode result 1
 
-set tri 0
-set nod 0
-
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri == 72 && $nod == 74 } {
-    puts " OCC481 : OK"
-} else {
-    puts " OCC481 : Faulty"
-}
-
+checktrinfo result -tri 72 -nod 74
 checkprops result -s 314.159 
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index e3483a1..ba17735 100644 (file)
@@ -6,30 +6,6 @@ puts ""
 ## The mesh should not rebuild on copied shape
 ###############################
 
-proc CHECKMESH {data nb_tria nb_nodes defl tol} {
-    regexp {This shape contains ([0-9]+) triangles.\s* ([0-9]+) nodes.} $data dummy cur_nb_tria cur_nb_nodes
-    regexp {Maximal deflection ([-0-9.+eE]+)} $data dummy cur_defl
-
-    if {$nb_tria == $cur_nb_tria && $nb_nodes == $cur_nb_nodes && abs($defl - $cur_defl) <= $tol} {
-      puts "OK: Triangulation is not changed"
-    } else {
-      if {$nb_tria != $cur_nb_tria} {
-        puts "Error: Wrong number of triangles, $cur_nb_tria instead of $nb_tria"
-      }
-      if {$nb_nodes != $cur_nb_nodes} {
-        puts "Error: Wrong number of nodes, $cur_nb_nodes instead of $nb_nodes"
-      }
-      set diff [expr {abs($defl - $cur_defl)}]
-      if {$diff > $tol} {
-        puts "Error: Wrong deflection, $cur_defl instead of $defl (difference is $diff)"
-      }
-    }
-    puts ""
-}
-
-###############################
-
-
 pload MODELING
 set tol 1.0e-7
 
@@ -47,17 +23,14 @@ tcopy -m f fc
 
 # Remesh initial face and check it is not changed
 incmesh f 1.0
-set data [trinfo f]
-CHECKMESH $data $base_tria $base_nodes $base_defl $tol
+checktrinfo f -tri ${base_tria} -nod ${base_nodes} -defl ${base_defl} -tol_abs_defl ${tol}
 
 # Compare mesh info from copied shape
-set data [trinfo fc]
-CHECKMESH $data $base_tria $base_nodes $base_defl $tol
+checktrinfo fc -tri ${base_tria} -nod ${base_nodes} -defl ${base_defl} -tol_abs_defl ${tol}
 
 # Remesh copied shape and compare mesh once again
 incmesh fc 1.0
-set data [trinfo fc]
-CHECKMESH $data $base_tria $base_nodes $base_defl $tol
+checktrinfo fc -tri ${base_tria} -nod ${base_nodes} -defl ${base_defl} -tol_abs_defl ${tol}
 
 copy fc result
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index 7ff41a4..022e4fd 100755 (executable)
@@ -12,11 +12,6 @@ checkshape result
 tclean result
 incmesh result .1
 triangles result
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full Maxtriangl
-
-if { $Maxtriangl < 1 } {
-   puts "Error : inside mesh for shading wasn't build"
-}
 
+checktrinfo result -tri
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index 6d758d4..7d9814e 100755 (executable)
@@ -18,24 +18,6 @@ incmesh result 0.01
 #View the result of mesh
 triangles result
 
-##############################################
-if { [catch { set tri_info [trinfo result] } catch_result] } {
-##############################################
-    puts "Faulty OCC1416"
-} else {
-    set ll [ llength ${tri_info} ]
-    if {${ll} < 6} {
-        puts "Faulty OCC1416"
-    } else {
-       regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-       regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-        if { $tri == 0 || $nod == 0 }  {
-            puts "Faulty OCC1416"
-        } else {
-            puts "Warning: OCC1416 looks like OK, but visual checking is required !!!!"
-        }
-    }
-}
-
+checktrinfo result -tri -nod
 checkprops result -s 863.938
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index d3cafc2..d00dc60 100755 (executable)
@@ -14,14 +14,5 @@ vdisplay result
 vsetdispmode result 1
 vfit
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-#($tri != 5370,$nod != 2783)($tri != 5356,$nod != 2774)($tri != 5354,$nod != 2773),aki251103
-if { ($tri != 5643 || $nod != 2915) }  {
-   puts "Shady OCC15 : shading problem may be, nb tri & nod were changed"
-}
-
+checktrinfo result -tri 1009 -nod 593
 checkview -display result -2d -path ${imagedir}/${test_image}.png
-
index 8b68df7..a542c69 100755 (executable)
@@ -1,7 +1,7 @@
-puts "TODO OCC12345 ALL: triangle: Faulty OCC15519"
-puts "TODO OCC12345 ALL: node: Faulty OCC15519"
-puts "TODO OCC12345 ALL: deflection: Faulty OCC15519"
-puts "TODO OCC12345 ALL: Faulty OCC15519"
+puts "TODO OCC12345 ALL: Error: Number of triangles"
+puts "TODO OCC12345 ALL: Error: Number of nodes"
+puts "TODO OCC12345 ALL: Error: Maximal deflection"
+
 puts "============"
 puts "OCC15519"
 puts "============"
@@ -12,29 +12,12 @@ puts ""
 
 set BugNumber OCC15519
 
-proc GetPercent {Value GoodValue} {
-   set Percent 0.
-   if {${GoodValue} != 0.} {
-      set Percent [expr abs(${Value} - ${GoodValue}) / abs(double(${GoodValue})) * 100.]
-   } elseif {${Value} != 0.} {
-      set Percent [expr abs(${GoodValue} - ${Value}) / abs(double(${Value})) * 100.]
-   } else {
-      set Percent 0.
-   }
-   return ${Percent}
-}
-
 restore [locate_data_file OCC15519.brep] result
 tclean result
 
 set Deflection 1.
 catch {incmesh result ${Deflection} }
 
-set InfoList [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $InfoList full tri
-regexp { +([-0-9.+eE]+) +nodes} $InfoList full nod
-regexp {Maximal deflection +([-0-9.+eE]+)} $InfoList full defl
-
 if { [string compare $tcl_platform(platform) "windows"] == 0 }  {
    set good_tri  96265
    set good_nod  71339
@@ -45,42 +28,5 @@ if { [string compare $tcl_platform(platform) "windows"] == 0 }  {
    set good_defl 0.99827404224216676
 }
 
-set percent_max 0.1
-set status 0
-
-set triangle_percent [GetPercent ${tri} ${good_tri}]
-puts "triangle_percent = ${triangle_percent}"
-if { ${triangle_percent} > ${percent_max} } {
-   puts "triangle: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "triangle: OK ${BugNumber}"
-}
-
-set node_percent [GetPercent ${nod} ${good_nod}]
-puts "node_percent = ${node_percent}"
-if { ${node_percent} > ${percent_max} } {
-   puts "node: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "node: OK ${BugNumber}"
-}
-
-set deflection_percent [GetPercent ${defl} ${good_defl}]
-puts "deflection_percent = ${deflection_percent}"
-if { ${deflection_percent} > ${percent_max} } {
-   puts "deflection: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "deflection: OK ${BugNumber}"
-}
-
-# Resume
-puts ""
-if { ${status} != 0 } {
-   puts "Faulty ${BugNumber}"
-} else {
-   puts "OK ${BugNumber}"
-}
-
+checktrinfo result -tri ${good_tri} -nod ${good_nod} -defl ${good_defl} -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001
 checkview -display result -2d -path ${imagedir}/${test_image}.png
index 7343b07..ddd91f0 100755 (executable)
@@ -10,15 +10,7 @@ vinit
 vdisplay result
 vsetdispmode result 1
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri != 2592 || $nod != 1369 }  {
-   puts "Faulty OCC16: here can be shading problem"
-}
-
 puts "If here is bug - face is displaied in wireframe mode"
 
+checktrinfo result -tri 2592 -nod 1369
 checkview -display result -2d -path ${imagedir}/${test_image}.png
-
index 620208c..2ae7348 100755 (executable)
@@ -1,4 +1,5 @@
-puts "TODO OCC12345 ALL: Faulty OCC17: here can be shading problem"
+puts "TODO OCC12345 ALL: Error: Number of triangles"
+puts "TODO OCC12345 ALL: Error: Number of nodes"
 
 puts "================"
 puts "OCC17"
@@ -21,14 +22,5 @@ vdisplay result
 vsetdispmode result 1
 vfit
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri != 100 && $nod != 94 }  {
-  puts "Faulty OCC17: here can be shading problem"
-}
-
+checktrinfo result -tri 100 -nod 94
 checkview -display result -2d -path ${imagedir}/${test_image}.png
-
-
index 41658b8..c8b9c4a 100755 (executable)
@@ -1,4 +1,4 @@
-puts "TODO OCC12345 ALL: Faulty OCC20: here is shading problem"
+puts "TODO OCC12345 ALL: Error: Number of triangles"
 
 puts "================"
 puts "OCC20"
@@ -23,13 +23,5 @@ vviewparams -scale 5.1346924 -proj 0.23495967 -0.302 0.923899 -up -0.7304302 0.5
 isos result 0
 triangles result
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri != 416 || $nod != 367 }  {
-   puts "Faulty OCC20: here is shading problem"
-}
-
+checktrinfo result -tri 416 -nod 367
 checkview -display result -2d -path ${imagedir}/${test_image}.png
-
index c23d370..1745390 100755 (executable)
@@ -1,4 +1,6 @@
-puts "TODO OCC11111 ALL: Faulty OCC21121"
+puts "TODO OCC11111 ALL: Error: Number of triangles"
+puts "TODO OCC11111 ALL: Error: Number of nodes"
+puts "TODO OCC11111 ALL: Error: Maximal deflection"
 puts "TODO OCC11111 ALL: Error : The area of result shape is"
 
 puts "============"
@@ -18,72 +20,6 @@ tclean result
 set Deflection 0.1
 catch {incmesh result ${Deflection} }
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-regexp {deflection +([-0-9.+eE]+)} $tri_info full defl
-
-if { [string compare $tcl_platform(platform) "windows"] == 0 }  {
-   puts "OS = Windows NT"
-   set good_tri  1555
-   set good_nod  1475
-   set good_defl 3.5015692105840144e-06
-} else {
-   puts "OS = Linux"
-   set good_tri  1555
-   set good_nod  1475
-   set good_defl 3.5015692105840144e-06
-}
-
-proc GetPercent {Value GoodValue} {
-    set Percent 0.
-    if {${GoodValue} != 0.} {
-       set Percent [expr abs(${Value} - ${GoodValue}) / abs(double(${GoodValue})) * 100.]
-    } elseif {${Value} != 0.} {
-       set Percent [expr abs(${GoodValue} - ${Value}) / abs(double(${Value})) * 100.]
-    } else {
-       set Percent 0.
-    }
-    return ${Percent}
-}
-
-set percent_max 0.1
-set status 0
-
-set triangle_percent [GetPercent ${tri} ${good_tri}]
-puts "triangle_percent = ${triangle_percent}"
-if { ${triangle_percent} > ${percent_max} } {
-   puts "triangle: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "triangle: OK ${BugNumber}"
-}
-
-set node_percent [GetPercent ${nod} ${good_nod}]
-puts "node_percent = ${node_percent}"
-if { ${node_percent} > ${percent_max} } {
-   puts "node: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "node: OK ${BugNumber}"
-}
-
-set deflection_percent [GetPercent ${defl} ${good_defl}]
-puts "deflection_percent = ${deflection_percent}"
-if { ${deflection_percent} > ${percent_max} } {
-   puts "deflection: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "deflection: OK ${BugNumber}"
-}
-
-# Resume
-puts ""
-if { ${status} != 0 } {
-   puts "Faulty ${BugNumber}"
-} else {
-   puts "OK ${BugNumber}"
-}
-
+checktrinfo result -tri 1555 -nod 1475 -defl 3.5015692105840144e-06 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001
 checkprops result -s 0
 checkview -display result -2d -path ${imagedir}/${test_image}.png
index 8b87e09..0a9e8a3 100755 (executable)
@@ -1,4 +1,4 @@
-puts "TODO OCC11111 ALL: Faulty OCC21122"
+puts "TODO OCC11111 ALL: Error: Maximal deflection"
 
 puts "============"
 puts "OCC21122"
@@ -17,74 +17,9 @@ tclean result
 set Deflection 0.1
 catch {incmesh result ${Deflection} }
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-regexp {Maximal deflection +([-0-9.+eE]+)} $tri_info full defl
-
-
-if { [string compare $tcl_platform(platform) "windows"] == 0 }  {
-   set good_tri  4322
-   set good_nod  4324
-   set good_defl 8.8817872205847652e-16
-   puts "OS = Windows NT"
-} else {
-   puts "OS = Linux"
-   set good_tri  4322
-   set good_nod  4324
-   set good_defl 8.8817872205847652e-16
-}
-
-proc GetPercent {Value GoodValue} {
-    set Percent 0.
-    if {${GoodValue} != 0.} {
-        set Percent [expr abs(${Value} - ${GoodValue}) / abs(double(${GoodValue})) * 100.]
-    } elseif {${Value} != 0.} {
-       set Percent [expr abs(${GoodValue} - ${Value}) / abs(double(${Value})) * 100.]
-    } else {
-       set Percent 0.
-    }
-    return ${Percent}
-}
-
-set percent_max 0.1
-set status 0
-
-set triangle_percent [GetPercent ${tri} ${good_tri}]
-puts "triangle_percent = ${triangle_percent}"
-if { ${triangle_percent} > ${percent_max} } {
-   puts "triangle: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "triangle: OK ${BugNumber}"
-}
-
-set node_percent [GetPercent ${nod} ${good_nod}]
-puts "node_percent = ${node_percent}"
-if { ${node_percent} > ${percent_max} } {
-   puts "node: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "node: OK ${BugNumber}"
-}
-
-set deflection_percent [GetPercent ${defl} ${good_defl}]
-puts "deflection_percent = ${deflection_percent}"
-if { ${deflection_percent} > ${percent_max} } {
-   puts "deflection: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "deflection: OK ${BugNumber}"
-}
-
+checktrinfo result -tri 4322 -nod 4324 -defl 8.8817872205847652e-16 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001
 checkprops result -s 275.426
-
 checknbshapes result -vertex 964 -edge 964 -wire 1 -face 1 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 1931
-if { ${status} != 0 } {
-   puts "Faulty ${BugNumber}"
-} else {
-   puts "OK ${BugNumber}"
-}
 
 vinit
 vdisplay result
@@ -92,4 +27,3 @@ vsetdispmode 1
 vfit
 
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
-
index 33f3333..5b9b229 100755 (executable)
@@ -21,74 +21,7 @@ tclean result
 set Deflection 0.001
 incmesh result ${Deflection}
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-regexp {deflection +([-0-9.+eE]+)} $tri_info full defl
-
-set env(os_type) $tcl_platform(platform)
-if { [string compare $env(os_type) "windows"] != 0 } {
-   puts "OS = Linux"
-   set good_tri  615414
-   set good_nod  311438
-   set good_defl 0.0032657364637550075
-} else {
-   puts "OS = Windows NT"
-   set good_tri  615414
-   set good_nod  311438
-   set good_defl 0.0032657364637550075
-}
-
-proc GetPercent {Value GoodValue} {
-    set Percent 0.
-    if {${GoodValue} != 0.} {
-        set Percent [expr abs(${Value} - ${GoodValue}) / abs(double(${GoodValue})) * 100.]
-    } elseif {${Value} != 0.} {
-       set Percent [expr abs(${GoodValue} - ${Value}) / abs(double(${Value})) * 100.]
-    } else {
-       set Percent 0.
-    }
-    return ${Percent}
-}
-
-set percent_max 0.1
-set status 0
-
-set triangle_percent [GetPercent ${tri} ${good_tri}]
-puts "triangle_percent = ${triangle_percent}"
-if { ${triangle_percent} > ${percent_max} } {
-   puts "triangle: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "triangle: OK ${BugNumber}"
-}
-
-set node_percent [GetPercent ${nod} ${good_nod}]
-puts "node_percent = ${node_percent}"
-if { ${node_percent} > ${percent_max} } {
-   puts "node: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "node: OK ${BugNumber}"
-}
-
-set deflection_percent [GetPercent ${defl} ${good_defl}]
-puts "deflection_percent = ${deflection_percent}"
-if { ${deflection_percent} > ${percent_max} } {
-   puts "deflection: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "deflection: OK ${BugNumber}"
-}
-
-# Resume
-puts ""
-if { ${status} != 0 } {
-   puts "Faulty ${BugNumber}"
-} else {
-   puts "OK ${BugNumber}"
-}
+checktrinfo result -tri 615414 -nod 311438 -defl 0.0032657364637550075 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001
 
 vinit
 vdisplay result
index 8e4bca0..52b4ba9 100755 (executable)
@@ -12,12 +12,5 @@ vdisplay result
 vsetdispmode result 1
 vfit
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri != 66 && $nod != 66 }  {
-  puts "Error : here is shading problem"
-}
-
+checktrinfo result -tri 66 -nod 66
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index 9c83340..9a6fee3 100755 (executable)
@@ -15,12 +15,5 @@ vsetdispmode result 1
 vfit
 triangles result
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri < 71 || $nod < 73 }  {
-  puts "Error (case 1) : here is shading problem"
-}
-
+checktrinfo result -tri 100 -nod 102
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 9a2b9a3..957d4c1 100755 (executable)
@@ -15,12 +15,5 @@ vsetdispmode result 1
 vfit
 triangles result
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri < 70 || $nod < 72 }  {
-  puts "Error (case 2) : here is shading problem"
-}
-
+checktrinfo result -tri 70 -nod 72
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 4856161..b3c77b8 100755 (executable)
@@ -20,14 +20,5 @@ isos result 0
 triangles result
 vfit
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri == 5496 && $nod == 5406 }  {
-    puts "Warning OCC428: here is shading problem, but source shape is invalid"
-} else {
-     puts "Warning OCC428: Shading of OCC428 was made, source shape is invalid"
-}
-
+checktrinfo result -tri !5496 -nod !5406
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 9d7f8b2..e9d13e9 100755 (executable)
@@ -14,12 +14,5 @@ isos result 0
 incmesh result .1
 triangles result
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri == 0 || $nod == 0 } {
-    puts "Error : Meshing algo cannot create mesh for faces with internal edges "
-}
-
+checktrinfo result -tri -nod
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index 3897d2d..c56e446 100755 (executable)
@@ -14,12 +14,5 @@ isos result 0
 incmesh result .1
 triangles result
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-if { $tri == 0 || $nod == 0 } {
-    puts "Error : Meshing algo cannot create mesh for faces with internal edges "
-}
-
+checktrinfo result -tri -nod
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index be9f6a8..5ff80e6 100755 (executable)
@@ -14,19 +14,10 @@ tclean result
 vinit
 vdisplay result
 vsetdispmode result 1
+vfit
 
 isos result 0
 triangles result
 
-set tri 0
-set nod 0
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-if { ${tri} == 0 && ${nod} == 0 } {
-    puts "Faulty ${BugNumber}"
-} else {
-    puts "OK ${BugNumber}"
-}
-
+checktrinfo result -tri -nod
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 521cf9f..9264651 100755 (executable)
@@ -1,4 +1,5 @@
-puts "TODO OCC12345 ALL: Error : here is shading problem"
+puts "TODO OCC12345 ALL: Error: Number of triangles"
+puts "TODO OCC12345 ALL: Error: Number of nodes"
 
 puts "============"
 puts "FRA62476"
@@ -15,12 +16,5 @@ tclean result
 incmesh result .1
 triangles result
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri != 93 && $nod != 56 } {
-   puts "Error : here is shading problem"
-}
-
+checktrinfo result -tri 93 -nod 56
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index b3e4128..96502d6 100755 (executable)
@@ -1,4 +1,3 @@
-
 puts "=========="
 puts "FRA62476"
 puts ""                                                                                  
@@ -14,13 +13,5 @@ tclean result
 incmesh result .1
 triangles result
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri !=239 && $nod != 145 } {
-   puts "Shady FRA62476: here may be shading problem, number tri & nod
-   are changed"
-}
-
+checktrinfo result -tri 1919 -nod 1008
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index a3a561d..6be7871 100755 (executable)
@@ -1,4 +1,5 @@
-puts "TODO OCC12345 ALL: Faulty PRO20333: here is shading problem"
+puts "TODO OCC12345 ALL: Error: Number of triangles"
+puts "TODO OCC12345 ALL: Error: Number of nodes"
 
 puts "============"
 puts "PRO20333"
@@ -15,12 +16,5 @@ isos result 0
 incmesh result .1
 triangles result
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri != 107 || $nod != 109 } {  
-   puts "Faulty PRO20333: here is shading problem"
-}
-
+checktrinfo result -tri 107 -nod 109
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index 990a9dd..14fddf0 100644 (file)
@@ -9,15 +9,8 @@ puts ""
 bsplinesurf s 2 4 0.0 3 0.34 1 0.67 1 1.0 3 1 2 0.0 2 1.0 2 10 0 0 1 6 0 0 1 4 0 0 1 2 0 0 1 0 0 0 1 10 5 0 1 6 5 0 1 4 5 0 1 1.5 9 0 1 0 5 0 1
 mkface result s
 incmesh result 1
-set tri_info [trinfo result]
-regexp {deflection ([0-9.+e-]+)} $tri_info full defl
 
-# check deflections
-if { $defl > 1 } {
-  puts "Error: too big deflection on original face (${defl} > 1)"
-} else {
-  puts "Deflection is OK (${defl})"
-}
+checktrinfo result -max_defl 1
 
 vdisplay result
 vsetdispmode 1
index a9b6e96..374c582 100644 (file)
@@ -9,15 +9,8 @@ puts ""
 bsplinesurf s 2 12 0.0 3 0.1 1 0.2 1 0.3 1 0.4 1 0.5 1 0.525 1 0.55 1 0.575 1 0.8 1 0.9 1 1.0 3 1 2 0.0 2 1.0 2 16 0 0 1 14 0 0 1 12 0 0 1 10 0 0 1 8 0 0 1 6 0 0 1 4 0 0 1 2 0 0 1 0 0 0 1 -2 0 0 1 -4 0 0 1 -6 0 0 1 -8 0 0 1 16 5 0 1 14 5 0 1 12 5 0 1 10 5 0 1 8 5 0 1 6 5 0 1 4 5 0 1 1.5 9 0 1 0 5 0 1 -2 5 0 1 -4 5 0 1 -6 5 0 1 -8 5 0 1
 mkface result s
 incmesh result 1
-set tri_info [trinfo result]
-regexp {deflection ([0-9.+e-]+)} $tri_info full defl
 
-# check deflections
-if { $defl > 1 } {
-  puts "Error: too big deflection on original face (${defl} > 1)"
-} else {
-  puts "Deflection is OK (${defl})"
-}
+checktrinfo result -max_defl 1
 
 vdisplay result
 vsetdispmode 1
index 7ca2f92..b8aff0b 100755 (executable)
@@ -13,22 +13,7 @@ restore [locate_data_file bug25179_nurbs-with-partial-seam.brep] result
 tclean result
 incmesh result 0.1
 
-set trinfo_s [trinfo result]
-regexp {([0-9]+) triangles} ${trinfo_s} str nbtri_s
-regexp {([0-9]+) nodes} ${trinfo_s} str nbnod_s
-regexp {deflection ([0-9.+e-]+)} ${trinfo_s} str defl_s
-
-if { ${nbtri_s} == 0 } {
-   puts "Error: shape contains 0 triangles"
-}
-
-if { ${nbnod_s} == 0 } {
-   puts "Error: shape contains 0 nodes"
-}
-
-if { ${defl_s} == 0 } {
-   puts "Error: deflection is 0"
-}
+checktrinfo result -tri -nod -defl
 
 if [catch { tricheck result } ] {
   puts "Error : Problem of build a mesh on specific geometry"
index a0f471f..8d8fd6c 100755 (executable)
@@ -16,21 +16,6 @@ restore [locate_data_file bug26359_parabola.brep] p
 vdisplay p
 vfit
 
-set trinfo_s [trinfo p]
-regexp {([0-9]+) triangles} ${trinfo_s} str nbtri_s
-regexp {([0-9]+) nodes} ${trinfo_s} str nbnod_s
-regexp {deflection ([0-9.+e-]+)} ${trinfo_s} str defl_s
-
-if { ${nbtri_s} == 0 } {
-   puts "Error: shape contains 0 triangles"
-}
-
-if { ${nbnod_s} == 0 } {
-   puts "Error: shape contains 0 nodes"
-}
-
-if { ${defl_s} == 0 } {
-   puts "Error: deflection is 0"
-}
+checktrinfo p -tri -nod -defl
 
 vdump ${imagedir}/${casename}.png
index 84468bd..4e39634 100755 (executable)
@@ -20,13 +20,5 @@ vdisplay result
 vsetdispmode 1
 vfit
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri == 0 || $nod == 0 } {
-   puts "Error : here is shading problem"
-}
-
+checktrinfo result -tri -nod
 checkview -display result -2d -path ${imagedir}/${test_image}.png
-
index 33b0d21..48fccea 100755 (executable)
@@ -20,12 +20,5 @@ vdisplay result
 vsetdispmode 1
 vfit
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri == 0 || $nod == 0 } {
-   puts "Error : here is shading problem"
-}
-
+checktrinfo result -tri -nod
 checkview -display result -2d -path ${imagedir}/${test_image}.png
index c16a088..b6afc89 100755 (executable)
@@ -22,13 +22,5 @@ vdisplay result
 vsetdispmode 1
 vfit
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri == 0 || $nod == 0 } {
-   puts "Error : here is shading problem"
-}
-
+checktrinfo result -tri -nod
 checkview -display result -2d -path ${imagedir}/${test_image}.png
-
index ef929d5..23c7cc6 100755 (executable)
@@ -21,13 +21,5 @@ vdisplay result
 vsetdispmode 1
 vfit
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri == 0 || $nod == 0 } {
-   puts "Error : here is shading problem"
-}
-
+checktrinfo result -tri -nod
 checkview -display result -2d -path ${imagedir}/${test_image}.png
-
index 5bbe00d..7fb62ea 100755 (executable)
@@ -26,16 +26,7 @@ Number of shapes in shape
 "
 
 checknbshapes b -ref ${nbshapes_expected_b} -t -m "Box"
-
-set tri_info_b [trinfo b]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info_b full tri_b
-regexp { +([-0-9.+eE]+) +nodes} $tri_info_b full nod_b
-if { $tri_b != 12} {
-  puts "Error: bad triangle numbers in box"
-}
-if { $nod_b != 24} {
-  puts "Error: bad node numbers in box"
-}
+checktrinfo b -tri 12 -nod 24
 
 vinit
 vsetdispmode 1
@@ -51,15 +42,7 @@ writevrml b ${aFile} 2 2
 
 loadvrml res ${aFile}
 
-set tri_info [trinfo res]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-if { $tri != 12} {
-  puts "Error: bad triangle numbers in box from VRML file"
-}
-if { $nod != 24} {
-  puts "Error: bad node numbers in box from VRML file"
-}
+checktrinfo res -tri 12 -nod 24
 
 set nbshapes_expected "
 Number of shapes in shape
index 02cf7ca..0edcd42 100755 (executable)
@@ -21,21 +21,12 @@ set mode 2
 
 writevrml res ${aFile} ${version} ${mode}
 
-set TrinfoAfter [trinfo res]
-set Log [loadvrml test ${aFile}]
-
-set status 1
+checktrinfo res -ref "${TrinfoBefore}"
 
-if { $TrinfoBefore != $TrinfoAfter } {
-  set status 0 
-}
+set Log [loadvrml test ${aFile}]
 
 if { [string length $Log] != 0 } {
-  set status 0 
-}
-
-if {$status == 1} {
-  puts "OK ${BugNumber}"
-} else {
   puts "Faulty ${BugNumber}"
+} else {
+  puts "OK ${BugNumber}"
 }
index ee58d04..264e507 100755 (executable)
@@ -36,12 +36,5 @@ tclean result
 vdisplay result
 vsetdispmode result 1
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri == 0 || $nod ==0 }  {
-  puts "Error : here is shading problem"
-}
-
+checktrinfo result -tri -nod
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 39cf824..326a926 100755 (executable)
@@ -23,12 +23,5 @@ vsetdispmode result 1
 isos result 0
 triangles result
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tr
-regexp { +([-0-9.+eE]+) +nodes} $info full nd
-
-if { $tr == 0 || $nd == 0 }  {
-   puts "Error : here is shading problem"
-}
-
+checktrinfo result -tri -nod
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 629f84a..c720628 100755 (executable)
@@ -10,12 +10,5 @@ tclean result
 incmesh result .9
 triangles result
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri != 88 && $nod != 90 }  {
-  puts "Faulty OCC19: here is shading problem"
-}
-
+checktrinfo result -tri 88 -nod 90
 checkview -display result -3d -path ${imagedir}/${test_image}.png
index db477de..063d0e9 100755 (executable)
@@ -13,14 +13,5 @@ vsetdispmode result 1
 isos result 0
 triangles result
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-#$tri/$nod:122/124aki251103
-
-if { $tri != 83 && $nod !=  85 }  {
-  puts "Shady OCC19: shading problem may be, nb tri & nod were changed"
-}
-
+checktrinfo result -tri 129 -nod 131
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 7613484..58b1190 100755 (executable)
@@ -15,20 +15,7 @@ vdisplay result
 vsetdispmode 1
 vfit
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-puts [format " tri= %s  noe= %s " $tri $nod]
-
-# Resume
-puts ""
-if { ${tri} == 0 } {
-   puts "Faulty ${BugNumber}"
-} else {
-   puts "OK ${BugNumber}"
-}
-
+checktrinfo result -tri
 checkprops result -s 9.92128e+06 
 checkshape result
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 7eb5553..efeaa7f 100755 (executable)
@@ -1,4 +1,5 @@
-puts "TODO OCC11111 ALL: OCC21578: Faulty"
+puts "TODO OCC11111 ALL: Error: Number of triangles"
+puts "TODO OCC11111 ALL: Error: Number of nodes"
 puts "TODO OCC11111 ALL: Error : The area of result shape is"
 
 puts "============"
@@ -19,35 +20,7 @@ vsetdispmode 1
 vdisplay result
 vfit
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-regexp {Maximal deflection +([-0-9.+eE]+)} $tri_info full defl
-
-set good_tri 231
-set good_nod 236
-set good_defl 0.004029564463949387
-
-puts [format " Triangles= %s  Nodes= %s Deflection= %s " $tri $nod $defl]
-
-set status 0
-if {${tri} != ${good_tri}} {
-  set status 1
-}
-if {${nod} != ${good_nod}} {
-  set status 1
-}
-#if {${defl} != ${good_defl}} {
-#  set status 1
-#}
-
-if { ${status} != 0 } {
-  puts "${BugNumber}: Faulty"
-} else {
-  puts "${BugNumber}: OK"
-}
-
+checktrinfo result -tri 231 -nod 236
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
 checkprops result -s 0 
 checkshape result
-
index 55e1aa3..3fded74 100755 (executable)
@@ -1,4 +1,6 @@
-puts "TODO OCC11111 ALL: Faulty OCC22188"
+puts "TODO OCC11111 ALL: Error: Number of triangles"
+puts "TODO OCC11111 ALL: Error: Number of nodes"
+puts "TODO OCC11111 ALL: Error: Maximal deflection"
 
 puts "============"
 puts "OCC22188"
@@ -18,11 +20,6 @@ vdisplay result
 vsetdispmode 1
 vfit
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-regexp {Maximal deflection +([-0-9.+eE]+)} $tri_info full defl
-
 if { [string compare $tcl_platform(platform) "windows"] == 0 }  {
    set good_tri  6114
    set good_nod  3080
@@ -33,56 +30,8 @@ if { [string compare $tcl_platform(platform) "windows"] == 0 }  {
     set good_defl 0.5153628044287929
 }
 
-proc GetPercent {Value GoodValue} {
-    set Percent 0.
-    if {${GoodValue} != 0.} {
-       set Percent [expr abs(${Value} - ${GoodValue}) / abs(double(${GoodValue})) * 100.]
-    } elseif {${Value} != 0.} {
-       set Percent [expr abs(${GoodValue} - ${Value}) / abs(double(${Value})) * 100.]
-    } else {
-       set Percent 0.
-    }
-    return ${Percent}
-}
-
-set percent_max 0.1
-set status 0
-
-set triangle_percent [GetPercent ${tri} ${good_tri}]
-puts "triangle_percent = ${triangle_percent}"
-if { ${triangle_percent} > ${percent_max} } {
-   puts "triangle: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "triangle: OK ${BugNumber}"
-}
-
-set node_percent [GetPercent ${nod} ${good_nod}]
-puts "node_percent = ${node_percent}"
-if { ${node_percent} > ${percent_max} } {
-   puts "node: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "node: OK ${BugNumber}"
-}
-
-set deflection_percent [GetPercent ${defl} ${good_defl}]
-puts "deflection_percent = ${deflection_percent}"
-if { ${deflection_percent} > ${percent_max} } {
-   puts "deflection: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "deflection: OK ${BugNumber}"
-}
-
+checktrinfo result -tri ${good_tri} -nod ${good_nod} -defl ${good_defl} -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001
 checkprops result -s 32416.7
 checkshape result
-
 checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 9
-if { ${status} != 0 } {
-   puts "Faulty ${BugNumber}"
-} else {
-   puts "OK ${BugNumber}"
-}
-
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 37d3e5c..53e2fcf 100755 (executable)
@@ -17,32 +17,5 @@ vfit
 
 vsetdispmode 1
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-
-set status 0
-
-if { ${tri} > 0 } {
-   puts "triangles: OK ${BugNumber}"
-} else {
-   puts "triangles: Faulty ${BugNumber}"
-   set status 1
-}
-
-if { ${nod} > 0 } {
-   puts "nodes: OK ${BugNumber}"
-} else {
-   puts "nodes: Faulty ${BugNumber}"
-   set status 1
-}
-
-# Resume
-puts ""
-if { ${status} != 0 } {
-   puts "Faulty ${BugNumber}"
-} else {
-   puts "OK ${BugNumber}"
-}
-
+checktrinfo result -tri -nod
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 2b9e69b..fe239d6 100755 (executable)
@@ -1,4 +1,6 @@
-puts "TODO OCC11111 ALL: Faulty OCC22502"
+puts "TODO OCC11111 ALL: Error: Number of triangles"
+puts "TODO OCC11111 ALL: Error: Number of nodes"
+puts "TODO OCC11111 ALL: Error: Maximal deflection"
 
 puts "============"
 puts "OCC22502"
@@ -20,64 +22,7 @@ tclean result
 set Deflection 0.001
 incmesh result ${Deflection}
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-regexp {Maximal deflection +([-0-9.+eE]+)} $tri_info full defl
-
-set good_tri  170
-set good_nod  172
-set good_defl 0.00061201255663038154
-
-proc GetPercent {Value GoodValue} {
-    set Percent 0.
-    if {${GoodValue} != 0.} {
-       set Percent [expr abs(${Value} - ${GoodValue}) / abs(double(${GoodValue})) * 100.]
-    } elseif {${Value} != 0.} {
-         set Percent [expr abs(${GoodValue} - ${Value}) / abs(double(${Value})) * 100.]
-    } else {
-       set Percent 0.
-    }
-    return ${Percent}
-}
-
-set percent_max 0.1
-set status 0
-
-set triangle_percent [GetPercent ${tri} ${good_tri}]
-puts "triangle_percent = ${triangle_percent}"
-if { ${triangle_percent} > ${percent_max} } {
-   puts "triangle: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "triangle: OK ${BugNumber}"
-}
-
-set node_percent [GetPercent ${nod} ${good_nod}]
-puts "node_percent = ${node_percent}"
-if { ${node_percent} > ${percent_max} } {
-   puts "node: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "node: OK ${BugNumber}"
-}
-
-set deflection_percent [GetPercent ${defl} ${good_defl}]
-puts "deflection_percent = ${deflection_percent}"
-if { ${deflection_percent} > ${percent_max} } {
-   puts "deflection: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "deflection: OK ${BugNumber}"
-}
-
-# Resume
-puts ""
-if { ${status} != 0 } {
-   puts "Faulty ${BugNumber}"
-} else {
-   puts "OK ${BugNumber}"
-}
+checktrinfo result -tri 170 -nod 172 -defl 0.00061201255663038154 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001
 
 vinit
 vdisplay result
index f4898f2..3029d74 100755 (executable)
@@ -17,33 +17,5 @@ vfit
 
 vsetdispmode 1
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-regexp {Maximal deflection +([-0-9.+eE]+)} $tri_info full defl
-
-set status 0
-
-if { ${tri} > 0 } {
-   puts "triangles: OK ${BugNumber}"
-} else {
-   puts "triangles: Faulty ${BugNumber}"
-   set status 1
-}
-
-if { ${nod} > 0 } {
-   puts "nodes: OK ${BugNumber}"
-} else {
-   puts "nodes: Faulty ${BugNumber}"
-   set status 1
-}
-
-# Resume
-puts ""
-if { ${status} != 0 } {
-   puts "Faulty ${BugNumber}"
-} else {
-   puts "OK ${BugNumber}"
-}
-
+checktrinfo result -tri -nod
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 75e1fd2..fd35fd8 100755 (executable)
@@ -16,63 +16,7 @@ restore [locate_data_file OCC22735-march_cube.brep] result
 
 vdisplay result
 
-set tri_info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full tri
-regexp { +([-0-9.+eE]+) +nodes} $tri_info full nod
-regexp {Maximal deflection +([-0-9.+eE]+)} $tri_info full defl
-
-set good_tri  48
-set good_nod  96
-set good_defl 0
-
-proc GetPercent {Value GoodValue} {
-    set Percent 0.
-    if {${GoodValue} != 0.} {
-       set Percent [expr abs(${Value} - ${GoodValue}) / abs(double(${GoodValue})) * 100.]
-    } elseif {${Value} != 0.} {
-       set Percent [expr abs(${GoodValue} - ${Value}) / abs(double(${Value})) * 100.]
-    } else {
-       set Percent 0.
-    }
-    return ${Percent}
-}
-set percent_max 0.1
-set status 0
-
-set triangle_percent [GetPercent ${tri} ${good_tri}]
-puts "triangle_percent = ${triangle_percent}"
-if { ${triangle_percent} > ${percent_max} } {
-   puts "triangle: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "triangle: OK ${BugNumber}"
-}
-
-set node_percent [GetPercent ${nod} ${good_nod}]
-puts "node_percent = ${node_percent}"
-if { ${node_percent} > ${percent_max} } {
-   puts "node: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "node: OK ${BugNumber}"
-}
-
-set deflection_percent [GetPercent ${defl} ${good_defl}]
-puts "deflection_percent = ${deflection_percent}"
-if { ${deflection_percent} > ${percent_max} } {
-   puts "deflection: Faulty ${BugNumber}"
-   set status 1
-} else {
-   puts "deflection: OK ${BugNumber}"
-}
-
-# Resume
-puts ""
-if { ${status} != 0 } {
-   puts "Faulty ${BugNumber}"
-} else {
-   puts "OK ${BugNumber}"
-}
+checktrinfo result -tri 48 -nod 96 -defl 0 -tol_rel_defl 0.001 -tol_rel_tri 0.001 -tol_rel_nod 0.001
 
 vfit
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index a1378a8..adaf1c3 100644 (file)
@@ -28,8 +28,9 @@ set tri_info [trinfo s]
 regexp { +([-0-9.+eE]+) +triangles} $tri_info full triIncmesh1
 
 vdisplay s
-set tri_info [trinfo s]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full triAutoTrShape
+
+checktrinfo s -tri !${triIncmesh1}
+
 vfit
 vdump $aShapeAutoTr
 
@@ -41,14 +42,8 @@ set tri_info [trinfo s]
 regexp { +([-0-9.+eE]+) +triangles} $tri_info full triIncmesh2
 
 vdisplay s
-set tri_info [trinfo s]
-regexp { +([-0-9.+eE]+) +triangles} $tri_info full triNotAutoTrShape
+
+checktrinfo s -tri ${triIncmesh2}
+
 vfit
 vdump $aShapeNotAutoTr
-
-if {${triIncmesh1} == ${triAutoTrShape}} {
-  puts "ERROR : Test failed. Incorrect triangulation in case of enabled auto triangulation feature."
-}
-if {${triIncmesh2} != ${triNotAutoTrShape}} {
-  puts "ERROR : Test failed. Incorrect triangulation in case of disabled auto triangulation feature."
-}
index 3b4153c..59ca1ea 100755 (executable)
@@ -14,18 +14,5 @@ isos result 0
 triangles result
 vfit
 
-set tri 0
-set nod 0
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-puts [format " tri= %s  nod= %s " $tri $nod]
-
-if { $tri != 5148 && $nod != 3042} {
-   puts " Warning:  OCC288 (case 1)  looks like OK, but visual checking is required!!"
-} else {
-   puts " OCC288 (case 1) : Faulty"
-}
-
+checktrinfo result -tri !5148 -nod !3042
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
-
index 1efb94d..7435a43 100755 (executable)
@@ -14,17 +14,5 @@ isos result 0
 triangles result
 vfit
 
-set tri 0
-set nod 0
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-puts [format " tri= %s  nod= %s " $tri $nod]
-
-if { $tri != 1170 && $nod != 647} {
-   puts " Warning:  OCC288 (case 2)  looks like OK, but visual checking is required !!!!"
-} else {
-   puts " OCC288 (case 2) : Faulty"
-}
-
+checktrinfo result -tri !1170 -nod !647
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 00aeb75..7592e93 100755 (executable)
@@ -14,18 +14,5 @@ isos result 0
 triangles result
 vfit
 
-set tri 0
-set nod 0
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-puts [format " tri= %s  nod= %s " $tri $nod]
-
-if { $tri != 1832 && $nod != 1574} {
-   puts " Warning:  OCC288 (case 3)  looks like OK, but visual checking is required !!!!"
-} else {
-   puts " OCC288 (case 3) : Faulty"
-}
-
+checktrinfo result -tri !1832 -nod !1574
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
-
index 9d67af8..08f3e7a 100755 (executable)
@@ -14,18 +14,5 @@ isos result 0
 triangles result
 vfit
 
-set tri 0
-set nod 0
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-puts [format " tri= %s  nod= %s " $tri $nod]
-
-if { $tri != 4176 && $nod != 2857} {
-   puts "Warning:  OCC288 (case 4)  looks like OK, but visual checking is required !!!!"
-} else {
-   puts " OCC288 (case 4) : Faulty"
-}
-
+checktrinfo result -tri !4176 -nod !2857
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
-
index 10b8f10..612fd84 100755 (executable)
@@ -13,20 +13,5 @@ isos result 0
 triangles result
 vfit
 
-set tri 0
-set nod 0
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-puts [format " tri= %s  nod= %s " $tri $nod]
-
-# ($tri == 7826 && $noe == 8246) || ($tri == 8218 && $noe == 8638),aki251103
-
-if { ($tri == 6268 && $noe == 6688) } {
-   puts "Shading of OCC288 (case 5)  looks like OK, but visual checking is required !"
-} else {
-   puts " Shady: Shading of OCC288 (case 5) may be bad, nb tri & nod changed"
-}
-
+checktrinfo result -tri 9448 -nod 9080
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
-
index 7d4efdf..f2cc81f 100755 (executable)
@@ -14,20 +14,6 @@ vdisplay result
 vsetdispmode result 1
 vfit
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri == 212909 && $nod == 158362 } {
-   puts "Warning OCC316: here is shading problem (some faces are lost)"
-} else {
-  if { $tri == 0 || $nod == 0 } {
-  puts " Warning  OCC316: here is shading problem (shading mesh is NOT created)"
-  isos result 0
-  } else {
-    puts "Warning: Shading of OCC316 looks OK, but visual checking is required"
-  }
-}
-
+checktrinfo result -tri !212909 -nod !158362
+checktrinfo result -tri -nod
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
-
index 6910405..a0fb391 100755 (executable)
@@ -29,13 +29,6 @@ set at_Z     6.47028180612483
 
 vviewparams -scale ${scale} -proj ${proj_X} ${proj_Y} ${proj_Z} -up ${up_X} ${up_Y} ${up_Z} -at ${at_X} ${at_Y} ${at_Z}
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri == 0 || $nod == 0 }  {
-  puts "Faulty OCC319: here is shading problem"
-}
-
+checktrinfo result -tri -nod
 checkprops result -s 8623.6
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index b46ccb0..8b4af3c 100755 (executable)
@@ -20,20 +20,5 @@ vfit
 vsetdispmode result 1
 vfit
 
-set tri 0
-set nod 0
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-puts [format " tri= %s  nod= %s " $tri $nod]
-
-if { $tri != 3808 && $nod != 2188} {
-   puts " OCC331: Looks like OK, but visual checking is required!!!"
-} else {
-   puts " OCC331: Faulty - Dark spot on a sphere after nurbsconvert"
-}
-
-
+checktrinfo result -tri !3808 -nod !2188
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
-
-
index 2c79cea..8ce1298 100755 (executable)
@@ -20,14 +20,5 @@ vclear
 isos result 0
 triangles result
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri == 9 && $nod == 8 }  {
-   puts "Warning OCC344: here is shading problem"
-} else {
-   puts "Shading of OCC344 looks like OK, but visual checking is required"
-}
-
+checktrinfo result -tri !9 -nod !8
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index 419e4a6..5f9207d 100755 (executable)
@@ -18,16 +18,7 @@ vsetdispmode result 1
 vfit
 triangles result
 
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tri
-regexp { +([-0-9.+eE]+) +nodes} $info full nod
-
-if { $tri != 92 || $nod != 92 }  {
-   puts "Faulty OCC364: here is shading problem"
-} else {
-   puts "Shading of  OCC364 is OK"
-}
-
+checktrinfo result -tri 92 -nod 92
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
 
 
index 9cdca63..5fee8d6 100755 (executable)
@@ -14,12 +14,6 @@ tclean result
 trinfo result
 vsetdispmode 1
 vfit
-set info [trinfo result]
-regexp { +([-0-9.+eE]+) +triangles} $info full tr
-regexp { +([-0-9.+eE]+) +nodes} $info full nd
-
-if { $tr <= 0 || $nd <= 0 } {
-    puts "Error : Problems with shading"
-}
 
+checktrinfo result -tri -nod
 checkview -screenshot -3d -path ${imagedir}/${test_image}.png
index d1f4570..8f1348b 100644 (file)
@@ -19,25 +19,10 @@ set LogBefore [trinfo res]
 
 writestl res ${aFile} ${anASCIImode}
 
-set LogAfter [trinfo res]
+checktrinfo res -ref "${LogBefore}"
 
-set status 1
-if { ![file exists ${aFile}] } {
-  set status 0
-}
-
-# Check file size
-set filesize [ file size ${aFile} ]
-if { ${filesize} == 0 } {
-  set status 0
-}
-
-if { $LogBefore != $LogAfter } {
-  set status 0
-}
-
-if {$status == 1} {
-  puts "OK: STL writer check given shape"
-} else {
+if { ![file exists ${aFile}] || [ file size ${aFile} ] == 0 } {
   puts "Error: STL writer does not check given shape"
+} else {
+  puts "OK: STL writer check given shape"
 }