Test cases were updated.
shape result CS
add b2 result
add Solid1 result
-nbshapes result
set square 750
shape result CS
add b2 result
add Solid1 result
-nbshapes result
set square 750
GetShape D $Cut1:2 result
-set nb_v_good 10
+checknbshapes result -vertex 10
+
set 2dviewer 0
restore [locate_data_file bug23562_V3.brep] result
-set nb_v_good 25
-set nb_e_good 45
-set nb_w_good 15
-set nb_f_good 15
-set nb_sh_good 1
-set nb_sol_good 1
-set nb_compsol_good 0
-set nb_compound_good 1
-set nb_shape_good 103
+checknbshapes result -vertex 25 -edge 45 -wire 15 -face 15 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 103
restore [locate_data_file bug23562_V4.brep] result
-set nb_v_good 24
-set nb_e_good 43
-set nb_w_good 20
-set nb_f_good 20
-set nb_sh_good 1
-set nb_sol_good 1
-set nb_compsol_good 0
-set nb_compound_good 1
-set nb_shape_good 110
+checknbshapes result -vertex 24 -edge 43 -wire 20 -face 20 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 110
restore [locate_data_file bug23562_V3.brep] result
-set nbsh_t 1
-set nb_v_good 31
-set nb_e_good 51
-set nb_w_good 16
-set nb_f_good 16
-set nb_sh_good 1
-set nb_sol_good 1
-set nb_compsol_good 0
-set nb_compound_good 1
-set nb_shape_good 117
+checknbshapes result -t -vertex 31 -edge 51 -wire 16 -face 16 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 117
restore [locate_data_file bug23562_V4.brep] result
-set nbsh_t 1
-set nb_v_good 30
-set nb_e_good 49
-set nb_w_good 21
-set nb_f_good 21
-set nb_sh_good 1
-set nb_sol_good 1
-set nb_compsol_good 0
-set nb_compound_good 1
-set nb_shape_good 124
+checknbshapes result -t -vertex 30 -edge 49 -wire 21 -face 21 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 124
explode a f
compound a_1 a_16 result
-set nb_v_good 6
-set nb_e_good 6
-set nb_w_good 1
-set nb_f_good 1
-set nb_sh_good 0
-set nb_sol_good 0
-set nb_compsol_good 0
-set nb_compound_good 1
-set nb_shape_good 15
+checknbshapes result -vertex 6 -edge 6 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 1 -shape 15
explode a f
compound a_1 a_16 result
-set nbsh_t 1
-set nb_v_good 12
-set nb_e_good 12
-set nb_w_good 2
-set nb_f_good 2
-set nb_sh_good 0
-set nb_sol_good 0
-set nb_compsol_good 0
-set nb_compound_good 1
-set nb_shape_good 29
+checknbshapes result -t -vertex 12 -edge 12 -wire 2 -face 2 -shell 0 -solid 0 -compsolid 0 -compound 1 -shape 29
}
}
-set glob_inf [info global nb_*_good]
-if { [regexp "nb_.*_good" $glob_inf] == 1 } {
- 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} vertices instead of ${nb_v}"
- } else {
- puts "Result shape contains ${nb_v} vertices"
- }
-}
-
-if { [info exists nb_e_good] } {
- regexp {EDGE +: +([-0-9.+eE]+)} $nb_info full nb_e
- if { ${nb_e} != ${nb_e_good} } {
- puts "Error : Result shape is WRONG because it must contains ${nb_e_good} edges instead of ${nb_e}"
- } else {
- puts "Result shape contains ${nb_e} edges"
- }
-}
-
-if { [info exists nb_w_good] } {
- regexp {WIRE +: +([-0-9.+eE]+)} $nb_info full nb_w
- if { ${nb_w} != ${nb_w_good} } {
- puts "Error : Result shape is WRONG because it must contains ${nb_w_good} wires instead of ${nb_w}"
- } else {
- puts "Result shape contains ${nb_w} wires"
- }
-}
-
-if { [info exists nb_f_good] } {
- regexp {FACE +: +([-0-9.+eE]+)} $nb_info full nb_f
- if { ${nb_f} != ${nb_f_good} } {
- puts "Error : Result shape is WRONG because it must contains ${nb_f_good} faces instead of ${nb_f}"
- } else {
- puts "Result shape contains ${nb_f} faces"
- }
-}
-
-if { [info exists nb_sh_good] } {
- regexp {SHELL +: +([-0-9.+eE]+)} $nb_info full nb_sh
- if { ${nb_sh} != ${nb_sh_good} } {
- puts "Error : Result shape is WRONG because it must contains ${nb_sh_good} shells instead of ${nb_sh}"
- } else {
- puts "Result shape contains ${nb_sh} shells"
- }
-}
-
-if { [info exists nb_sol_good] } {
- regexp {SOLID +: +([-0-9.+eE]+)} $nb_info full nb_sol
- if { ${nb_sol} != ${nb_sol_good} } {
- puts "Error : Result shape is WRONG because it must contains ${nb_sol_good} solids instead of ${nb_sol}"
- } else {
- puts "Result shape contains ${nb_sol} solids"
- }
-}
-
-if { [info exists nb_compsol_good] } {
- regexp {COMPSOLID +: +([-0-9.+eE]+)} $nb_info full nb_compsol
- if { ${nb_compsol} != ${nb_compsol_good} } {
- puts "Error : Result shape is WRONG because it must contains ${nb_compsol_good} compsolids instead of ${nb_compsol}"
- } else {
- puts "Result shape contains ${nb_compsol} compsolids"
- }
-}
-
-if { [info exists nb_compound_good] } {
- regexp {COMPOUND +: +([-0-9.+eE]+)} $nb_info full nb_compound
- if { ${nb_compound} != ${nb_compound_good} } {
- puts "Error : Result shape is WRONG because it must contains ${nb_compound_good} compounds instead of ${nb_compound}"
- } else {
- puts "Result shape contains ${nb_compound} compounds"
- }
-}
-
-if { [info exists nb_shape_good] } {
- regexp {SHAPE +: +([-0-9.+eE]+)} $nb_info full nb_shape
- if { ${nb_shape} != ${nb_shape_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_shape} shapes"
- }
-}
-
-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 { [file exists ${aFile}] } {
readstl result ${aFile}
-set nb_v_good 8
-set nb_e_good 18
-set nb_w_good 12
-set nb_f_good 12
-set nb_sh_good 1
-set nb_sol_good 0
-set nb_compsol_good 0
-set nb_compound_good 0
-set nb_shape_good 51
-
+checknbshapes result -vertex 8 -edge 18 -wire 12 -face 12 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 51
# Check file size
set size_status 0
set filesize [ file size ${aFile} ]
if { [file exists ${aFile}] } {
readstl result ${aFile}
-set nb_v_good 8
-set nb_e_good 18
-set nb_w_good 12
-set nb_f_good 12
-set nb_sh_good 1
-set nb_sol_good 0
-set nb_compsol_good 0
-set nb_compound_good 0
-set nb_shape_good 51
-
+checknbshapes result -vertex 8 -edge 18 -wire 12 -face 12 -shell 1 -solid 0 -compsolid 0 -compound 0 -shape 51
# Check file size
set size_status 0
set filesize [ file size ${aFile} ]
set square 6
-set nb_v_good 8
-set nb_e_good 12
-set nb_w_good 6
-set nb_f_good 6
-set nb_sh_good 1
-set nb_sol_good 1
-set nb_compsol_good 0
-set nb_compound_good 0
-set nb_shape_good 34
-
+checknbshapes result -vertex 8 -edge 12 -wire 6 -face 6 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 34
file delete -force [glob -nocomplain ${NameFile}]
set 2dviewer 1
set square 6
-set nb_v_good 8
-set nb_e_good 12
-set nb_w_good 6
-set nb_f_good 6
-set nb_sh_good 1
-set nb_sol_good 1
-set nb_compsol_good 0
-set nb_compound_good 0
-set nb_shape_good 34
-
+checknbshapes result -vertex 8 -edge 12 -wire 6 -face 6 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 34
file delete -force [glob -nocomplain ${NameFile}]
set 2dviewer 1
set square 313292
-set nb_v_good 12
-set nb_e_good 20
-set nb_w_good 9
-set nb_f_good 9
-set nb_sh_good 1
-set nb_sol_good 1
-set nb_compsol_good 0
-set nb_compound_good 0
-set nb_shape_good 52
-
+checknbshapes result -vertex 12 -edge 20 -wire 9 -face 9 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 52
set 2dviewer 1
set square 123446
-set nb_v_good 33
-set nb_e_good 52
-set nb_w_good 23
-set nb_f_good 21
-set nb_sh_good 1
-set nb_sol_good 1
-set nb_compsol_good 0
-set nb_compound_good 1
-set nb_shape_good 132
-
+checknbshapes result -vertex 33 -edge 52 -wire 23 -face 21 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 132
set 2dviewer 1
set square 15902.8
-set nb_v_good 14
-set nb_e_good 15
-set nb_w_good 1
-set nb_f_good 1
-set nb_sh_good 0
-set nb_sol_good 0
-set nb_compsol_good 0
-set nb_compound_good 0
-set nb_shape_good 31
-
+checknbshapes result -vertex 14 -edge 15 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0 -shape 31
set 2dviewer 1
set square 6998.53
-set nb_v_good 4482
-set nb_e_good 6781
-set nb_w_good 2309
-set nb_f_good 2305
-set nb_sh_good 1
-set nb_sol_good 1
-set nb_compsol_good 0
-set nb_compound_good 0
-set nb_shape_good 15879
-
+checknbshapes result -vertex 4482 -edge 6781 -wire 2309 -face 2305 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 15879
set 3dviewer 1
restore [locate_data_file bug26572_issue_12_new_input.brep] s
-nbshapes s -t
-
smallview
donly s
fit
# 1
checkarea a 158.466 1e-1 0.01
-nbshapes a -t
-
vinit
vsetdispmode 1
vclear
tpcompound result
set square 8.76948e+09
-set nb_v_good 8
-set nb_e_good 12
-set nb_w_good 4
-set nb_f_good 4
-set nb_sh_good 0
-set nb_sol_good 0
-set nb_compsol_good 0
-set nb_compound_good 2
-set nb_shape_good 30
-
+checknbshapes result -vertex 8 -edge 12 -wire 4 -face 4 -shell 0 -solid 0 -compsolid 0 -compound 2 -shape 30
set 2dviewer 0
tpcompound result
set square 8.80533e+09
-set nb_v_good 8
-set nb_e_good 12
-set nb_w_good 4
-set nb_f_good 4
-set nb_sh_good 0
-set nb_sol_good 0
-set nb_compsol_good 0
-set nb_compound_good 2
-set nb_shape_good 30
-
+checknbshapes result -vertex 8 -edge 12 -wire 4 -face 4 -shell 0 -solid 0 -compsolid 0 -compound 2 -shape 30
set 2dviewer 0
tpcompound result
set square 7.72668e+08
-set nb_v_good 175
-set nb_e_good 175
-set nb_w_good 38
-set nb_f_good 38
-set nb_sh_good 0
-set nb_sol_good 0
-set nb_compsol_good 0
-set nb_compound_good 2
-set nb_shape_good 428
-
+checknbshapes result -vertex 175 -edge 175 -wire 38 -face 38 -shell 0 -solid 0 -compsolid 0 -compound 2 -shape 428
set 2dviewer 0
tpcompound result
set square 7.72668e+08
-set nb_v_good 175
-set nb_e_good 175
-set nb_w_good 38
-set nb_f_good 38
-set nb_sh_good 0
-set nb_sol_good 0
-set nb_compsol_good 0
-set nb_compound_good 2
-set nb_shape_good 428
-
+checknbshapes result -vertex 175 -edge 175 -wire 38 -face 38 -shell 0 -solid 0 -compsolid 0 -compound 2 -shape 428
set 2dviewer 0
renamevar s1_1 result
-nbshapes result
-
-set nb_v_good 2
-set nb_e_good 3
-set nb_w_good 1
-set nb_f_good 1
-set nb_sh_good 0
-set nb_sol_good 0
-set nb_compsol_good 0
-set nb_compound_good 0
-set nb_shape_good 7
-
+checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0 -shape 7
set tol [tolerance result ]
regexp { *Tolerance +MAX=([-0-9.+eE]+)} ${tol} full max_tol
puts "max_tol=${max_tol}"
renamevar s1_1 result
-nbshapes result
-
-set nb_v_good 2
-set nb_e_good 3
-set nb_w_good 1
-set nb_f_good 1
-set nb_sh_good 0
-set nb_sol_good 0
-set nb_compsol_good 0
-set nb_compound_good 0
-set nb_shape_good 7
-
+checknbshapes result -vertex 2 -edge 3 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0 -shape 7
set tol [tolerance result ]
regexp { *Tolerance +MAX=([-0-9.+eE]+)} ${tol} full max_tol
puts "max_tol=${max_tol}"
tpcompound result
set square 159588
- set nb_v_good 140
- set nb_e_good 144
- set nb_w_good 36
- set nb_f_good 31
- set nb_sh_good 0
- set nb_sol_good 0
- set nb_compsol_good 0
- set nb_compound_good 1
- set nb_shape_good 352
-
+ checknbshapes result -vertex 140 -edge 144 -wire 36 -face 31 -shell 0 -solid 0 -compsolid 0 -compound 1 -shape 352
set 2dviewer 0
}
checkshape result
-set nb_f_good 192
+checknbshapes result -face 192
set 2dviewer 0
vaxo
vfit
-set nb_v_good 6
-set nb_e_good 14
-set nb_w_good 8
-set nb_f_good 7
-set nb_sh_good 1
-set nb_sol_good 1
-set nb_compsol_good 0
-set nb_compound_good 0
-set nb_shape_good 37
-
+checknbshapes result -vertex 6 -edge 14 -wire 8 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 37
# relative tolerance (%)
set rel_tol 1
set area_eps 0
vaxo
vfit
-set nb_v_good 6
-set nb_e_good 14
-set nb_w_good 8
-set nb_f_good 7
-set nb_sh_good 1
-set nb_sol_good 1
-set nb_compsol_good 0
-set nb_compound_good 0
-set nb_shape_good 37
-
+checknbshapes result -vertex 6 -edge 14 -wire 8 -face 7 -shell 1 -solid 1 -compsolid 0 -compound 0 -shape 37
# relative tolerance (%)
set rel_tol 1
set area_eps 0
bbuild r
explode r
-nbshapes r
-
# do all possible checks of validity
tolerance r
checkshape r
bcommon result S1 S2
-set nb_info [nbshapes result]
-regexp {COMPOUND +: +([-0-9.+eE]+)} $nb_info full err
-regexp {SHELL +: +([-0-9.+eE]+)} $nb_info full err1
-
-if { $err != 1 || $err1 != 1} {
- puts "Faulty : result should be a shell, but not a compound of faces"
-} else {
- puts "BUC60787 - OK"
-}
+checknbshapes result -shell 1 -compound 1 -m "result should be a shell, but not a compound of faces"
set square 45000
set 2dviewer 0
bcut result S1 S2
-set nb_info [nbshapes result]
-regexp {COMPOUND +: +([-0-9.+eE]+)} $nb_info full err
-regexp {SHELL +: +([-0-9.+eE]+)} $nb_info full err1
+checknbshapes result -shell 1 -compound 1 -m "result should be a shell, but not a compound of faces"
-if { $err != 1 || $err1 != 1} {
- puts "Faulty : result should be a shell, but not a compound of faces"
-} else {
- puts "BUC60787 - OK"
-}
set square 150200
set 2dviewer 0
bcut result S1 S2
-set nb_info [nbshapes result]
-regexp {COMPOUND +: +([-0-9.+eE]+)} $nb_info full err
-regexp {SHELL +: +([-0-9.+eE]+)} $nb_info full err1
+checknbshapes result -shell 1 -compound 1 -m "result should be a shell, but not a compound of faces"
-if { $err != 1 || $err1 != 1} {
- puts "Faulty : result should be a shell, but not a compound of faces"
-} else {
- puts "BUC60788 - OK"
-}
set square 150200
set 2dviewer 0
bcommon result S1 S2
-set nb_info [nbshapes result]
-regexp {COMPOUND +: +([-0-9.+eE]+)} $nb_info full err
-regexp {SHELL +: +([-0-9.+eE]+)} $nb_info full err1
+checknbshapes result -shell 1 -compound 1 -m "result should be a shell, but not a compound of faces"
-if { $err != 1 || $err1 != 1} {
- puts "Faulty : result should be a shell, but not a compound of faces"
-} else {
- puts "BUC60788 - OK"
-}
set square 45000
set 2dviewer 0
mkface f pl
bsection result sh f
-set nb_info [nbshapes result]
-regexp {EDGE +: +([-0-9.+eE]+)} $nb_info full ed
+checknbshapes result -edge 5 -m "SECTION operation"
-if { $ed == 5 } {
- puts " BUC60865 : SECTION operation was made properly"
-} else {
- puts "Faulty BUC60865: SECTION operation was made wrongly"
-}
set length 4.5
set 2dviewer 0
set nb_info [nbshapes result]
regexp {EDGE +: +([-0-9.+eE]+)} $nb_info full edgeness
-
- #set fullness [ nbshapes res ]
- #puts "$fullness"
- #set qq [ lindex $fullness 0 ]
- #set edgeness [ lindex $fullness 10 ]
- # puts "$edgeness"
if { $edgeness == 1 } {
puts "Shape is empty, it is Faulty result"
-puts "TODO OCC11111 ALL: Error : Result shape is WRONG"
+puts "TODO OCC11111 ALL: Error : is WRONG because number of "
puts "============"
puts "OCC10160"
set square 1.30062e+07
# Analysis of "nbshapes res"
-set nb_v_good 20
-set nb_e_good 28
-set nb_w_good 16
-set nb_f_good 15
-set nb_sh_good 3
-set nb_sol_good 3
-set nb_compsol_good 0
-set nb_compound_good 1
-set nb_shape_good 86
-
+checknbshapes result -vertex 20 -edge 28 -wire 16 -face 15 -shell 3 -solid 3 -compsolid 0 -compound 1 -shape 86
set 2dviewer 0
set square 3.20326e+07
# Analysis of "nbshapes res"
-set nb_v_good 116
-set nb_e_good 173
-set nb_w_good 67
-set nb_f_good 63
-set nb_sh_good 1
-set nb_sol_good 1
-set nb_compsol_good 0
-set nb_compound_good 1
-set nb_shape_good 422
-
+checknbshapes result -vertex 116 -edge 173 -wire 67 -face 63 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 422
set 2dviewer 0
set square 3.05154e+07
# Analysis of "nbshapes res"
-set nb_v_good 96
-set nb_e_good 143
-set nb_w_good 51
-set nb_f_good 48
-set nb_sh_good 1
-set nb_sol_good 1
-set nb_compsol_good 0
-set nb_compound_good 1
-set nb_shape_good 341
-
+checknbshapes result -vertex 96 -edge 143 -wire 51 -face 48 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 341
set 2dviewer 0
set square 6.38359e+06
# Analysis of "nbshapes res"
-set nb_v_good 108
-set nb_e_good 161
-set nb_w_good 61
-set nb_f_good 60
-set nb_sh_good 3
-set nb_sol_good 3
-set nb_compsol_good 0
-set nb_compound_good 1
-set nb_shape_good 397
-
+checknbshapes result -vertex 108 -edge 161 -wire 61 -face 60 -shell 3 -solid 3 -compsolid 0 -compound 1 -shape 397
set 2dviewer 0
-puts "TODO OCC11111 ALL: Error : Result shape is WRONG"
+puts "TODO OCC11111 ALL: Error : is WRONG because number of "
puts "============"
puts "OCC10160"
set square 4.75218e+07
# Analysis of "nbshapes res"
-set nb_v_good 32
-set nb_e_good 60
-set nb_w_good 32
-set nb_f_good 29
-set nb_sh_good 1
-set nb_sol_good 1
-set nb_compsol_good 0
-set nb_compound_good 1
-set nb_shape_good 156
-
+checknbshapes result -vertex 32 -edge 60 -wire 32 -face 29 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 156
set 2dviewer 0
-puts "TODO OCC11111 ALL: Error : Result shape is WRONG"
+puts "TODO OCC11111 ALL: Error : is WRONG because number of "
puts "TODO OCC11111 ALL: Error : The square of result shape is"
puts "============"
puts "OCC10160"
set square 2.36194e+07
# Analysis of "nbshapes res"
-set nb_v_good 24
-set nb_e_good 34
-set nb_w_good 20
-set nb_f_good 19
-set nb_sh_good 4
-set nb_sol_good 4
-set nb_compsol_good 0
-set nb_compound_good 1
-set nb_shape_good 106
-
+checknbshapes result -vertex 24 -edge 34 -wire 20 -face 19 -shell 4 -solid 4 -compsolid 0 -compound 1 -shape 106
set 2dviewer 0
-puts "TODO OCC11111 ALL: Error : Result shape is WRONG"
+puts "TODO OCC11111 ALL: Error : is WRONG because number of "
puts "============"
puts "OCC10160"
puts "============"
set square 3.52471e+07
# Analysis of "nbshapes res"
-set nb_v_good 24
-set nb_e_good 34
-set nb_w_good 20
-set nb_f_good 17
-set nb_sh_good 3
-set nb_sol_good 3
-set nb_compsol_good 0
-set nb_compound_good 1
-set nb_shape_good 102
-
+checknbshapes result -vertex 24 -edge 34 -wire 20 -face 17 -shell 3 -solid 3 -compsolid 0 -compound 1 -shape 102
set 2dviewer 0
-puts "TODO OCC11111 ALL: Error : Result shape is WRONG"
+puts "TODO OCC11111 ALL: Error : is WRONG because number of "
puts "============"
puts "OCC10160"
puts "============"
set square 784833
# Analysis of "nbshapes res"
-set nb_v_good 53
-set nb_e_good 75
-set nb_w_good 38
-set nb_f_good 34
-set nb_sh_good 6
-set nb_sol_good 6
-set nb_compsol_good 0
-set nb_compound_good 1
-set nb_shape_good 213
-
+checknbshapes result -vertex 53 -edge 75 -wire 38 -face 34 -shell 6 -solid 6 -compsolid 0 -compound 1 -shape 213
set 2dviewer 0