0026342: No materials are read from STEP
[occt.git] / tests / bugs / end
index af27a99..d225ba8 100755 (executable)
@@ -2,9 +2,10 @@ if { [info exists square] } {
     set prop "square"
     set mass $square
     if { [info exists tol_square] } {
-       regexp {Mass +: +([-0-9.+eE]+)} [sprops result $tol_square] full m
+      # tol_square - The epsilon defines relative precision of computation
+      regexp {Mass +: +([-0-9.+eE]+)} [sprops result $tol_square] full m
     } else {
-       regexp {Mass +: +([-0-9.+eE]+)} [sprops result] full m
+      regexp {Mass +: +([-0-9.+eE]+)} [sprops result] full m
     }
 }
 if { [info exists length] } {
@@ -19,39 +20,43 @@ if { [info exists length] } {
 #if mass (length or square) is empty in test case then result should be an empty shape.
 if { [info exists mass] } {
     if { [string compare $subgroup "moddata"] != 0 } {
-       puts "checkshape"
-       checkshape result
+      puts "checkshape"
+      checkshape result
     }
       
     if { [string compare "$mass" "empty"] != 0 } {
-       if { $m == 0 } {
-                   puts "Error : The command is not valid. The $prop is 0."
-       }
-       if { $mass > 0 } {
-                   puts "The expected $prop is $mass"
-       }
-       #check of change of square is < 1%
-       if { ($mass != 0 && [expr 1.*abs($mass - $m)/$mass] > 0.01) || ($mass == 0 && $m != 0) } {
-           puts "Error : The $prop of result shape is $m"
-       }
+      if { $m == 0 } {
+        puts "Error : The command is not valid. The $prop is 0."
+      }
+      if { $mass > 0 } {
+        puts "The expected $prop is $mass"
+      }
+      #check of change of square is < 1%
+      if { ($mass != 0 && [expr 1.*abs($mass - $m)/$mass] > 0.01) || ($mass == 0 && $m != 0) } {
+        puts "Error : The $prop of result shape is $m"
+      }
     } else {
-       if { $m != 0 } {
-                   puts "Error : The command is not valid. The $prop is $m"
-       }
+      if { $m != 0 } {
+        puts "Error : The command is not valid. The $prop is $m"
+      }
     }
 }
 
 set glob_inf [info global nb_*_good]
 if { [regexp "nb_.*_good" $glob_inf] == 1 } {
-    set nb_info [nbshapes result]
+    if { [info exists nbsh_t] } {
+      set nb_info [nbshapes result -t]
+    } else {
+      set nb_info [nbshapes result]
+    }
 }
 
 if { [info exists nb_v_good] } {
     regexp {VERTEX +: +([-0-9.+eE]+)} $nb_info full nb_v
     if { ${nb_v} != ${nb_v_good} } {
-        puts "Error : Result shape is WRONG because it must contains ${nb_v_good} vertexes instead of ${nb_v}"
+        puts "Error : Result shape is WRONG because it must contains ${nb_v_good} vertices instead of ${nb_v}"
     } else {
-        puts "Result shape contains ${nb_v} vertexes"
+        puts "Result shape contains ${nb_v} vertices"
     }
 }
 
@@ -127,31 +132,66 @@ if { [info exists nb_shape_good] } {
     }
 }
 
+if { [info exists nb_fe_good] && [info exists nb_fe] } {
+    if { ${nb_fe} != ${nb_fe_good} } {
+        puts "Error : Result shape is WRONG because it must contains ${nb_shape_good} shapes instead of ${nb_shape}"
+    } else {
+        puts "Result shape contains ${nb_fe} free edges"
+    }
+}
+
+if { [info exists rel_tol] } {
+   puts "\nChecking triangulation area (triarea command)..."
+   set rel_err [expr abs([CheckTriArea result $area_eps])]
+   if { $rel_err > $rel_tol } {
+      puts "Error   : area by triangles differs from the actual area by $rel_err %"
+   } else {
+      if { $rel_tol > 1 && $rel_tol < 100 } {
+        puts "Error: Improvement: The current area difference is $rel_err instead of $rel_tol"
+      }
+   }
+}
+
 if { [isdraw result] } {
-    if { [info exists 2dviewer] } {
-       clear
-       smallview
-       donly result
-       fit
-       xwd $imagedir/${test_image}.png
+  if { [info exists 2dviewer] } {
+    clear
+    smallview
+    donly result
+    fit
+    xwd $imagedir/${test_image}.png
+  }
+  if { [info exists 3dviewer] } {
+    #for multiview support: dump result from all opened views
+    set view_str [vviewlist long]
+    if { [llength ${view_str}] == 0 } {
+       vinit
+       set view_str [vviewlist long]
     }
-    if { [info exists 3dviewer] } {
-       vinit
-       vclear
-       vdisplay result
-       vsetdispmode 1
-       vfit
-       vzfit
-       vdump $imagedir/${test_image}.png
+    set view_list [regexp -all -inline {\S+} $view_str]
+    foreach {view_name} $view_list {
+      vactivate $view_name
+      vclear
+      vdisplay result
+      vsetdispmode 1
+      vfit
+      vzfit
+      vdump $imagedir/${test_image}_[regsub -all {/} $view_name {_}].png
     }
+  }
 }
 
-if { [info exist only_screen] } {
-   vdump $imagedir/${test_image}.png
+if { [info exists only_screen] } {
+  #for multiview support: dump result from all opened views
+  set view_str [vviewlist long]
+  set view_list [regexp -all -inline {\S+} $view_str]
+  foreach {view_name} $view_list {
+    vactivate $view_name
+    vdump $imagedir/${test_image}_[regsub -all {/} $view_name {_}].png
+  }
 }
 
-if { [info exist only_screen2d] } {
-   v2ddump $imagedir/${test_image}.png
+if { [info exists only_screen_axo] } {
+   xwd $imagedir/${test_image}.png
 }
 
 # to end a test script