1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0027145: Remove redundant usage of GetPercent procedure

Usage of GetPercent procedure was replaced by checkreal procedure.
This commit is contained in:
ski 2016-02-09 16:57:15 +03:00 committed by abv
parent cc9f459173
commit cd718a73c7
22 changed files with 161 additions and 1119 deletions

View File

@ -8,18 +8,6 @@ set BugNumber OCC15489
# Constructor gp_Lin2d(A, B, C) creates line with origin point in infinity
######################################################
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}
}
pload QAcommands
set A 1e-20
@ -30,33 +18,8 @@ set OriginList [OCC15489 $A $B $C]
regexp {X_0 += +([-0-9.+eE]+)} $OriginList full X_0
regexp {Y_0 += +([-0-9.+eE]+)} $OriginList full Y_0
set percent_max 0.1
set good_X_0 -1.9999999999999999e-20
set good_Y_0 2
set status 0
set X_0_percent [GetPercent ${X_0} ${good_X_0}]
puts "X_0_percent = ${X_0_percent}"
if { ${X_0_percent} > ${percent_max} } {
puts "X_0: Faulty ${BugNumber}"
set status 1
} else {
puts "X_0: OK ${BugNumber}"
}
set Y_0_percent [GetPercent ${Y_0} ${good_Y_0}]
puts "Y_0_percent = ${Y_0_percent}"
if { ${Y_0_percent} > ${percent_max} } {
puts "Y_0: Faulty ${BugNumber}"
set status 1
} else {
puts "Y_0: OK ${BugNumber}"
}
# Resume
puts ""
if { ${status} != 0 } {
puts "Faulty ${BugNumber}"
} else {
puts "OK ${BugNumber}"
}
checkreal "X_0" ${X_0} ${good_X_0} 0 0.001
checkreal "Y_0" ${Y_0} ${good_Y_0} 0 0.001

View File

@ -6,18 +6,6 @@ puts ""
# Wrong calculation of bnd box for edge if edge has polygon of triangulation
#######################################################################################
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 BugNumber OCC12661
restore [locate_data_file OCC12661.brep] result
@ -30,53 +18,12 @@ set x2 [lindex ${res} 3]
set y2 [lindex ${res} 4]
set z2 [lindex ${res} 5]
set good_x1 -6.3659273065258741
set good_y1 0.7051405053395956
set good_z1 -2.5792617865186296
set good_x2 6.3659273065258795
set good_y2 7.6599592236605769
set good_z2 3.0815250146676485
set percent_max 0.1
set status 0
set x1_percent [GetPercent ${x1} ${good_x1}]
set y1_percent [GetPercent ${y1} ${good_y1}]
set z1_percent [GetPercent ${z1} ${good_z1}]
set x2_percent [GetPercent ${x2} ${good_x2}]
set y2_percent [GetPercent ${y2} ${good_y2}]
set z2_percent [GetPercent ${z2} ${good_z2}]
if {${x1_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : x1 is wrong"
set status 1
}
if {${y1_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : y1 is wrong"
set status 1
}
if {${z1_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : z1 is wrong"
set status 1
}
if {${x2_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : x2 is wrong"
set status 1
}
if {${y2_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : y2 is wrong"
set status 1
}
if {${z2_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : z2 is wrong"
set status 1
}
if { ${status} == 0 } {
puts "${BugNumber}: OK"
} else {
puts "${BugNumber}: Faulty"
}
checkreal "x1" ${x1} -6.3659273065258741 0 0.001
checkreal "y1" ${y1} 0.7051405053395956 0 0.001
checkreal "z1" ${z1} -2.5792617865186296 0 0.001
checkreal "x2" ${x2} 6.3659273065258795 0 0.001
checkreal "y2" ${y2} 7.6599592236605769 0 0.001
checkreal "z2" ${z2} 3.0815250146676485 0 0.001
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@ -21,38 +21,12 @@ regexp {FACE[ \t]*: MAX=([-0-9.+eE]+)} $ToleranceList full FaceTolerance
regexp {EDGE[ \t]*: MAX=([-0-9.+eE]+)} $ToleranceList full EdgeTolerance
regexp {VERTEX[ \t]*: MAX=([-0-9.+eE]+)} $ToleranceList full VertexTolerance
set percent_max 0.1
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 IsOk 1
set minTolerance ${EdgeTolerance}
if { ${minTolerance} > ${VertexTolerance} } {
set minTolerance $(VertexTolerance)
}
set minTolerance_percent [GetPercent ${minTolerance} ${oTolerance}]
puts "minTolerance_percent = ${minTolerance_percent} %"
if { ${minTolerance_percent} > ${percent_max} } {
set IsOk 0
}
if { ${IsOk} == 0 } {
puts "${BugNumber}: Faulty"
} else {
puts "${BugNumber}: OK"
}
checkreal "Min tolerance" ${minTolerance} ${oTolerance} 0 0.001
checkmaxtol result -ref 2279.641703013865
checknbshapes result -shell 1
checkfreebounds result 5

View File

@ -1,4 +1,5 @@
puts "TODO OCC25597 ALL: OCC22967: Faulty"
puts "TODO OCC25597 ALL: Error: Vertex tolerance"
puts "TODO OCC25597 ALL: Error: Edge tolerance"
puts "============"
puts "OCC22967"
puts "============"
@ -8,7 +9,6 @@ puts ""
###########################################################################################################
set BugNumber OCC22967
set check_value 8.46459e-006
restore [locate_data_file bug22967_Cylinder_1.brep] b1
restore [locate_data_file bug22967_Scale_1.brep] b2
@ -19,42 +19,10 @@ set info [ maxtolerance result ]
regexp {Edge[ \t]*:.*Max[ \t]*([-0-9.+eE]+)} $info full last1
regexp {Vertex[ \t]*:.*Max[ \t]*([-0-9.+eE]+)} $info full last
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 5
set status 0
set Tolerance_percent [expr abs ( [GetPercent ${last} ${check_value}] ) ]
if {${Tolerance_percent} > ${percent_max}} {
set status 1
} else {
set status 0
}
set Tolerance_percent [expr abs ( [GetPercent ${last1} ${check_value}] ) ]
if {${Tolerance_percent} > ${percent_max}} {
set status 1
} else {
set status 0
}
# Resume
if {${status} > 0} {
puts "${BugNumber}: Faulty"
} else {
puts "OK ${BugNumber}"
}
set check_value 8.46459e-006
checkreal "Vertex tolerance" ${last} ${check_value} 0 0.05
checkreal "Edge tolerance" ${last1} ${check_value} 0 0.05
checkprops result -s 668843
checkshape result
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@ -1,4 +1,4 @@
puts "TODO OCC25597 ALL: OCC23218: Faulty"
puts "TODO OCC25597 ALL: Error: Reached tolerance"
puts "============"
puts "OCC23218"
puts "============"
@ -23,24 +23,4 @@ puts "Finish project operation ..."
set GoodToleranceReached 6.3315853638232248e-007
regexp {Tolerance Reached=([-0-9.+eE]+)} $result full ToleranceReached
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 ToleranceReached_percent [expr abs ( [GetPercent ${ToleranceReached} ${GoodToleranceReached}] ) ]
if {${ToleranceReached_percent} > ${percent_max}} {
puts "${BugNumber}: Faulty"
} else {
puts "OK ${BugNumber}"
}
checkreal "Reached tolerance" ${ToleranceReached} ${GoodToleranceReached} 0 0.001

View File

@ -8,19 +8,6 @@ puts ""
set BugNumber OCC14782
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 OCC14782.draw] res
bounds res t1 t2
@ -63,14 +50,4 @@ if { [llength ${segment_list}] < 7 } {
set ll2 [lindex [length res] end]
puts "length2=${ll2}"
set percent_max 0.1
set length_percent [GetPercent ${ll1} ${ll2}]
puts "length_percent = ${length_percent}"
puts ""
if { ${length_percent} > ${percent_max} } {
puts "3. Faulty ${BugNumber}"
} else {
puts "3. OK ${BugNumber}"
}
checkreal "length1" ${ll1} ${ll2} 0 0.001

View File

@ -10,18 +10,6 @@ set BugNumber OCC15570
pload XDE
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}
}
igesbrep [locate_data_file OCC15570.igs] a *
tpcompound result
@ -33,76 +21,11 @@ set xmax [lindex ${BoundList} 3]
set ymax [lindex ${BoundList} 4]
set zmax [lindex ${BoundList} 5]
set percent_max 0.1
set good_xmin -22.500000100000001
set good_ymin -88.366946209482094
set good_zmin -1.0000002775557561e-07
set good_xmax 22.500000100000001
set good_ymax 22.776076069021901
set good_zmax 86.12676222997429
set status 0
set xmin_percent [GetPercent ${xmin} ${good_xmin}]
puts "xmin_percent = ${xmin_percent}"
if { ${xmin_percent} > ${percent_max} } {
puts "xmin: Faulty ${BugNumber}"
set status 1
} else {
puts "xmin: OK ${BugNumber}"
}
set ymin_percent [GetPercent ${ymin} ${good_ymin}]
puts "ymin_percent = ${ymin_percent}"
if { ${ymin_percent} > ${percent_max} } {
puts "ymin: Faulty ${BugNumber}"
set status 1
} else {
puts "ymin: OK ${BugNumber}"
}
set zmin_percent [GetPercent ${zmin} ${good_zmin}]
puts "zmin_percent = ${zmin_percent}"
if { ${zmin_percent} > ${percent_max} } {
puts "zmin: Faulty ${BugNumber}"
set status 1
} else {
puts "zmin: OK ${BugNumber}"
}
set xmax_percent [GetPercent ${xmax} ${good_xmax}]
puts "xmax_percent = ${xmax_percent}"
if { ${xmax_percent} > ${percent_max} } {
puts "xmax: Faulty ${BugNumber}"
set status 1
} else {
puts "xmax: OK ${BugNumber}"
}
set ymax_percent [GetPercent ${ymax} ${good_ymax}]
puts "ymax_percent = ${ymax_percent}"
if { ${ymax_percent} > ${percent_max} } {
puts "ymax: Faulty ${BugNumber}"
set status 1
} else {
puts "ymax: OK ${BugNumber}"
}
set zmax_percent [GetPercent ${zmax} ${good_zmax}]
puts "zmax_percent = ${zmax_percent}"
if { ${zmax_percent} > ${percent_max} } {
puts "zmax: Faulty ${BugNumber}"
set status 1
} else {
puts "zmax: OK ${BugNumber}"
}
# Resume
puts ""
if { ${status} != 0 } {
puts "Faulty ${BugNumber}"
} else {
puts "OK ${BugNumber}"
}
checkreal "xmin" ${xmin} -22.500000100000001 0 0.001
checkreal "ymin" ${ymin} -88.366946209482094 0 0.001
checkreal "zmin" ${zmin} -1.0000002775557561e-07 0 0.001
checkreal "xmax" ${xmax} 22.500000100000001 0 0.001
checkreal "ymax" ${ymax} 22.776076069021901 0 0.001
checkreal "zmax" ${zmax} 86.12676222997429 0 0.001
checkview -display result -2d -path ${imagedir}/${test_image}.png

View File

@ -8,18 +8,6 @@ puts ""
set BugNumber OCC16119
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 OCC16119-c1.draw] c1
restore [locate_data_file OCC16119-c2.draw] c2
restore [locate_data_file OCC16119-c31.draw] c31
@ -38,23 +26,6 @@ set deltaX [dval dvx1-dvx2]
set deltaY [dval dvy1-dvy2]
set deltaZ [dval dvz1-dvz2]
set percent_max 0.1
set good_deltaX -3.5527136788005009e-015
set good_deltaY -3.5527136788005009e-015
set good_deltaZ 8.8817841970012523e-016
set deltaX_percent [GetPercent ${deltaX} ${good_deltaX}]
puts "deltaX_percent = ${deltaX_percent}"
set deltaY_percent [GetPercent ${deltaY} ${good_deltaY}]
puts "deltaY_percent = ${deltaY_percent}"
set deltaZ_percent [GetPercent ${deltaZ} ${good_deltaZ}]
puts "deltaZ_percent = ${deltaZ_percent}"
if {${deltaX_percent} > ${percent_max} || ${deltaY_percent} > ${percent_max} || ${deltaZ_percent} > ${percent_max} } {
puts "${BugNumber}: Faulty"
} else {
puts "${BugNumber}: OK"
}
checkreal "deltaX" ${deltaX} -3.5527136788005009e-015 0 0.001
checkreal "deltaY" ${deltaY} -3.5527136788005009e-015 0 0.001
checkreal "deltaZ" ${deltaZ} 8.8817841970012523e-016 0 0.001

View File

@ -17,35 +17,10 @@ set extrema_length [llength ${extrema_res} ]
if {${extrema_length} < 8 } {
puts "${BugNumber}: Faulty"
} else {
regexp {Extrema 1 is point : +([-0-9.+eE]+) +([-0-9.+eE]+) +([-0-9.+eE]+)} $extrema_res full X Y Z
set good_X 1
set good_Y 3.0891916307971289e-33
set good_Z 0.059999999999999998
set percent_max 0.1
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 X_percent [GetPercent ${X} ${good_X}]
set Y_percent [GetPercent ${Y} ${good_Y}]
set Z_percent [GetPercent ${Z} ${good_Z}]
if {${X_percent} > ${percent_max} || ${Y_percent} > ${percent_max} || ${Z_percent} > ${percent_max}} {
puts "X = ${X} Y = ${Y} Z = ${Z}"
puts "X_percent = ${X_percent} Y_percent = ${Y_percent} Z_percent = ${Z_percent}"
puts "${BugNumber}: Faulty"
} else {
puts "${BugNumber}: OK"
}
regexp {Extrema 1 is point : +([-0-9.+eE]+) +([-0-9.+eE]+) +([-0-9.+eE]+)} $extrema_res full X Y Z
checkreal "X" ${X} 1 0 0.001
checkreal "Y" ${Y} 3.0891916307971289e-33 0 0.001
checkreal "Z" ${Z} 0.059999999999999998 0 0.001
}

View File

@ -21,21 +21,6 @@ puts ""
set BugNumber OCC22809
#
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
#
psphere a 100
nurbsconvert r1 a
line l 0 0 -100 0 0 1
@ -53,8 +38,6 @@ set word2 [string compare $info2 "point"]
set status_point 0
puts "ski $word1"
puts "ski $word2"
if { ${word1} == 0 && ${word2} == 0 } {
set status_point 0
} else {
@ -84,38 +67,11 @@ set good_z2 1.000000000000000e+02
set dump1 [ dump brics_1 ]
regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} $dump1 full x1 y1 z1
set status_xyz1 0
set x1_percent [GetPercent ${x1} ${good_x1}]
puts "x1_percent = ${x1_percent}"
if { ${x1_percent} > ${percent_max} } {
puts "x1: Faulty ${BugNumber}"
set status_xyz1 1
} else {
puts "x1: OK ${BugNumber}"
}
checkreal "x1" ${x1} ${good_x1} 0 0.001
checkreal "y1" ${y1} ${good_y1} 0 0.001
set y1_percent [GetPercent ${y1} ${good_y1}]
puts "y1_percent = ${y1_percent}"
if { ${y1_percent} > ${percent_max} } {
puts "y1: Faulty ${BugNumber}"
set status_xyz1 1
} else {
puts "y1: OK ${BugNumber}"
}
set z1_percent [GetPercent ${z1} ${good_z1}]
puts "z1_percent = ${z1_percent}"
if { ${z1_percent} > ${percent_max} } {
set z1_percent [GetPercent ${z1} ${good_z2}]
puts "z1_percent = ${z1_percent}"
if { ${z1_percent} > ${percent_max} } {
puts "z1: Faulty ${BugNumber}"
set status_xyz1 1
} else {
puts "z1: OK ${BugNumber}"
}
} else {
puts "z1: OK ${BugNumber}"
if { abs ($z1 - $good_z1) > 0.001 * abs ($good_z1) } {
checkreal "z1" ${z1} ${good_z2} 0 0.001
}
set dump2 [ dump brics_2 ]
@ -123,43 +79,15 @@ set dump2 [ dump brics_2 ]
set dump2 [ dump brics_41 ]
regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} $dump2 full x2 y2 z2
set status_xyz2 0
set x2_percent [GetPercent ${x2} ${good_x2}]
puts "x2_percent = ${x2_percent}"
if { ${x2_percent} > ${percent_max} } {
puts "x2: Faulty ${BugNumber}"
set status_xyz2 1
} else {
puts "x2: OK ${BugNumber}"
checkreal "x2" ${x2} ${good_x2} 0 0.001
checkreal "y2" ${y2} ${good_y2} 0 0.001
if { abs ($z2 - $good_z2) > 0.001 * abs ($good_z2) } {
checkreal "z2" ${z2} ${good_z1} 0 0.001
}
set y2_percent [GetPercent ${y2} ${good_y2}]
puts "y2_percent = ${y2_percent}"
if { ${y2_percent} > ${percent_max} } {
puts "y2: Faulty ${BugNumber}"
set status_xyz2 1
} else {
puts "y2: OK ${BugNumber}"
}
set z2_percent [GetPercent ${z2} ${good_z2}]
puts "z2_percent = ${z2_percent}"
if { ${z2_percent} > ${percent_max} } {
set z2_percent [GetPercent ${z2} ${good_z1}]
puts "z2_percent = ${z2_percent}"
if { ${z2_percent} > ${percent_max} } {
puts "z2: Faulty ${BugNumber}"
set status_xyz2 1
} else {
puts "z2: OK ${BugNumber}"
}
} else {
puts "z2: OK ${BugNumber}"
}
if { ${status_point} == 0 && ${status_nb} == 0 && ${status_xyz1} == 0 && ${status_xyz2} == 0 } {
if { ${status_point} == 0 && ${status_nb} == 0 } {
puts "OK ${BugNumber}"
} else {
puts "Faulty ${BugNumber}"
}

View File

@ -21,21 +21,6 @@ puts ""
set BugNumber OCC22809
#
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
#
psphere a 100
scalexyz r2 a 2 1 1
line l 0 0 -100 0 0 1
@ -81,38 +66,11 @@ set dump1 [ dump brics_1 ]
regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} $dump1 full x1 y1 z1
set status_xyz1 0
set x1_percent [GetPercent ${x1} ${good_x1}]
puts "x1_percent = ${x1_percent}"
if { ${x1_percent} > ${percent_max} } {
puts "x1: Faulty ${BugNumber}"
set status_xyz1 1
} else {
puts "x1: OK ${BugNumber}"
}
checkreal "x1" ${x1} ${good_x1} 0 0.001
checkreal "y1" ${y1} ${good_y1} 0 0.001
set y1_percent [GetPercent ${y1} ${good_y1}]
puts "y1_percent = ${y1_percent}"
if { ${y1_percent} > ${percent_max} } {
puts "y1: Faulty ${BugNumber}"
set status_xyz1 1
} else {
puts "y1: OK ${BugNumber}"
}
set z1_percent [GetPercent ${z1} ${good_z1}]
puts "z1_percent = ${z1_percent}"
if { ${z1_percent} > ${percent_max} } {
set z1_percent [GetPercent ${z1} ${good_z2}]
puts "z1_percent = ${z1_percent}"
if { ${z1_percent} > ${percent_max} } {
puts "z1: Faulty ${BugNumber}"
set status_xyz1 1
} else {
puts "z1: OK ${BugNumber}"
}
} else {
puts "z1: OK ${BugNumber}"
if { abs ($z1 - $good_z1) > 0.001 * abs ($good_z1) } {
checkreal "z1" ${z1} ${good_z2} 0 0.001
}
set dump2 [ dump brics_2 ]
@ -120,45 +78,15 @@ set dump2 [ dump brics_2 ]
set dump2 [ dump brics_23 ]
regexp {Point : ([-0-9.+eE]+), ([-0-9.+eE]+), ([-0-9.+eE]+)} $dump2 full x2 y2 z2
set status_xyz2 0
set x2_percent [GetPercent ${x2} ${good_x2}]
puts "x2_percent = ${x2_percent}"
if { ${x2_percent} > ${percent_max} } {
puts "x2: Faulty ${BugNumber}"
set status_xyz2 1
} else {
puts "x2: OK ${BugNumber}"
checkreal "x2" ${x2} ${good_x2} 0 0.001
checkreal "y2" ${y2} ${good_y2} 0 0.001
if { abs ($z2 - $good_z2) > 0.001 * abs ($good_z2) } {
checkreal "z2" ${z2} ${good_z1} 0 0.001
}
set y2_percent [GetPercent ${y2} ${good_y2}]
puts "y2_percent = ${y2_percent}"
if { ${y2_percent} > ${percent_max} } {
puts "y2: Faulty ${BugNumber}"
set status_xyz2 1
} else {
puts "y2: OK ${BugNumber}"
}
set z2_percent [GetPercent ${z2} ${good_z2}]
puts "z2_percent = ${z2_percent}"
if { ${z2_percent} > ${percent_max} } {
set z2_percent [GetPercent ${z2} ${good_z1}]
puts "z2_percent = ${z2_percent}"
if { ${z2_percent} > ${percent_max} } {
puts "z2: Faulty ${BugNumber}"
set status_xyz2 1
} else {
puts "z2: OK ${BugNumber}"
}
} else {
puts "z2: OK ${BugNumber}"
}
# Resume
puts ""
if { ${status_point} == 0 && ${status_nb} == 0 && ${status_xyz1} == 0 && ${status_xyz2} == 0 } {
if { ${status_point} == 0 && ${status_nb} == 0 } {
puts "OK ${BugNumber}"
} else {
puts "Faulty ${BugNumber}"
}

View File

@ -8,22 +8,6 @@ puts ""
set BugNumber OCC22809
#
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
#
psphere a 100
nurbsconvert r1 a
line l -0.000001 0.0000000001 -100 0 0 1
@ -65,33 +49,9 @@ set good_x1 -1.000000000000000e-06
set good_y1 1.000000000000000e-10
set good_z1 -1.000000000000000e+02
set status_xyz1 0
set x1_percent [GetPercent ${x1} ${good_x1}]
puts "x1_percent = ${x1_percent}"
if { ${x1_percent} > ${percent_max} } {
puts "x1: Faulty ${BugNumber}"
set status_xyz1 1
} else {
puts "x1: OK ${BugNumber}"
}
set y1_percent [GetPercent ${y1} ${good_y1}]
puts "y1_percent = ${y1_percent}"
if { ${y1_percent} > ${percent_max} } {
puts "y1: Faulty ${BugNumber}"
set status_xyz1 1
} else {
puts "y1: OK ${BugNumber}"
}
set z1_percent [GetPercent ${z1} ${good_z1}]
puts "z1_percent = ${z1_percent}"
if { ${z1_percent} > ${percent_max} } {
puts "z1: Faulty ${BugNumber}"
set status_xyz1 1
} else {
puts "z1: OK ${BugNumber}"
}
checkreal "x1" ${x1} ${good_x1} 0 0.001
checkreal "y1" ${y1} ${good_y1} 0 0.001
checkreal "z1" ${z1} ${good_z1} 0 0.001
set dump2 [ dump brics_2 ]
# N.B. multiple result points are to be processed by other algorithms
@ -103,37 +63,13 @@ set good_x2 -1.000000000000000e-06
set good_y2 1.000000000000000e-10
set good_z2 1.000000000000000e+02
set status_xyz2 0
set x2_percent [GetPercent ${x2} ${good_x2}]
puts "x2_percent = ${x2_percent}"
if { ${x2_percent} > ${percent_max} } {
puts "x2: Faulty ${BugNumber}"
set status_xyz2 1
} else {
puts "x2: OK ${BugNumber}"
}
set y2_percent [GetPercent ${y2} ${good_y2}]
puts "y2_percent = ${y2_percent}"
if { ${y2_percent} > ${percent_max} } {
puts "y2: Faulty ${BugNumber}"
set status_xyz2 1
} else {
puts "y2: OK ${BugNumber}"
}
set z2_percent [GetPercent ${z2} ${good_z2}]
puts "z2_percent = ${z2_percent}"
if { ${z2_percent} > ${percent_max} } {
puts "z2: Faulty ${BugNumber}"
set status_xyz2 1
} else {
puts "z2: OK ${BugNumber}"
}
checkreal "x2" ${x2} ${good_x2} 0 0.001
checkreal "y2" ${y2} ${good_y2} 0 0.001
checkreal "z2" ${z2} ${good_z2} 0 0.001
# Resume
puts ""
if { ${status_point} == 0 && ${status_nb} == 0 && ${status_xyz1} == 0 && ${status_xyz2} == 0 } {
if { ${status_point} == 0 && ${status_nb} == 0 } {
puts "OK ${BugNumber}"
} else {
puts "Faulty ${BugNumber}"

View File

@ -8,21 +8,6 @@ puts ""
set BugNumber OCC22809
#
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
#
psphere a 100
scalexyz r2 a 2 1 1
line l -0.000001 0.0000000001 -100 0 0 1
@ -67,33 +52,9 @@ set good_x1 -1.000000000000000e-06
set good_y1 1.000000000000000e-10
set good_z1 -1.000000000000000e+02
set status_xyz1 0
set x1_percent [GetPercent ${x1} ${good_x1}]
puts "x1_percent = ${x1_percent}"
if { ${x1_percent} > ${percent_max} } {
puts "x1: Faulty ${BugNumber}"
set status_xyz1 1
} else {
puts "x1: OK ${BugNumber}"
}
set y1_percent [GetPercent ${y1} ${good_y1}]
puts "y1_percent = ${y1_percent}"
if { ${y1_percent} > ${percent_max} } {
puts "y1: Faulty ${BugNumber}"
set status_xyz1 1
} else {
puts "y1: OK ${BugNumber}"
}
set z1_percent [GetPercent ${z1} ${good_z1}]
puts "z1_percent = ${z1_percent}"
if { ${z1_percent} > ${percent_max} } {
puts "z1: Faulty ${BugNumber}"
set status_xyz1 1
} else {
puts "z1: OK ${BugNumber}"
}
checkreal "x1" ${x1} ${good_x1} 0 0.001
checkreal "y1" ${y1} ${good_y1} 0 0.001
checkreal "z1" ${z1} ${good_z1} 0 0.001
set dump2 [ dump brics_2 ]
# N.B. multiple result points are to be processed by other algorithms
@ -105,39 +66,12 @@ set good_x2 -1.000000000000000e-06
set good_y2 1.000000000000000e-10
set good_z2 1.000000000000000e+02
set status_xyz2 0
set x2_percent [GetPercent ${x2} ${good_x2}]
puts "x2_percent = ${x2_percent}"
if { ${x2_percent} > ${percent_max} } {
puts "x2: Faulty ${BugNumber}"
set status_xyz2 1
} else {
puts "x2: OK ${BugNumber}"
}
checkreal "x2" ${x2} ${good_x2} 0 0.001
checkreal "y2" ${y2} ${good_y2} 0 0.001
checkreal "z2" ${z2} ${good_z2} 0 0.001
set y2_percent [GetPercent ${y2} ${good_y2}]
puts "y2_percent = ${y2_percent}"
if { ${y2_percent} > ${percent_max} } {
puts "y2: Faulty ${BugNumber}"
set status_xyz2 1
} else {
puts "y2: OK ${BugNumber}"
}
set z2_percent [GetPercent ${z2} ${good_z2}]
puts "z2_percent = ${z2_percent}"
if { ${z2_percent} > ${percent_max} } {
puts "z2: Faulty ${BugNumber}"
set status_xyz2 1
} else {
puts "z2: OK ${BugNumber}"
}
# Resume
puts ""
if { ${status_point} == 0 && ${status_nb} == 0 && ${status_xyz1} == 0 && ${status_xyz2} == 0 } {
if { ${status_point} == 0 && ${status_nb} == 0 } {
puts "OK ${BugNumber}"
} else {
puts "Faulty ${BugNumber}"
}

View File

@ -14,22 +14,6 @@ smallview
# 1 step
set exception_status 0
set e1_status 0
set status 0
set percent_max 0.1
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 OCC23165-edge1.brep] e1
@ -57,38 +41,12 @@ if {$index > -1} {
set e1_good_y2 5.700038816113608
set e1_good_z2 -1.6251884728673096
set e1_x1_percent [GetPercent ${e1_x1} ${e1_good_x1}]
set e1_y1_percent [GetPercent ${e1_y1} ${e1_good_y1}]
set e1_z1_percent [GetPercent ${e1_z1} ${e1_good_z1}]
set e1_x2_percent [GetPercent ${e1_x2} ${e1_good_x2}]
set e1_y2_percent [GetPercent ${e1_y2} ${e1_good_y2}]
set e1_z2_percent [GetPercent ${e1_z2} ${e1_good_z2}]
if {${e1_x1_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : x1 for e1 is wrong"
set e1_status 1
}
if {${e1_y1_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : y1 for e1 is wrong"
set e1_status 1
}
if {${e1_z1_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : z1 for e1 is wrong"
set e1_status 1
}
if {${e1_x2_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : x2 for e1 is wrong"
set e1_status 1
}
if {${e1_y2_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : y2 for e1 is wrong"
set e1_status 1
}
if {${e1_z2_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : z2 for e1 is wrong"
set e1_status 1
}
checkreal "e1_x1" ${e1_x1} ${e1_good_x1} 0 0.001
checkreal "e1_y1" ${e1_y1} ${e1_good_y1} 0 0.001
checkreal "e1_z1" ${e1_z1} ${e1_good_z1} 0 0.001
checkreal "e1_x2" ${e1_x2} ${e1_good_x2} 0 0.001
checkreal "e1_y2" ${e1_y2} ${e1_good_y2} 0 0.001
checkreal "e1_z2" ${e1_z2} ${e1_good_z2} 0 0.001
}
# 2 step
@ -113,39 +71,14 @@ set good_x2 -17.589416490940806
set good_y2 5.7000000802283299
set good_z2 -1.6252272087525899
set x1_percent [GetPercent ${x1} ${good_x1}]
set y1_percent [GetPercent ${y1} ${good_y1}]
set z1_percent [GetPercent ${z1} ${good_z1}]
set x2_percent [GetPercent ${x2} ${good_x2}]
set y2_percent [GetPercent ${y2} ${good_y2}]
set z2_percent [GetPercent ${z2} ${good_z2}]
checkreal "x1" ${x1} ${good_x1} 0 0.001
checkreal "y1" ${y1} ${good_y1} 0 0.001
checkreal "z1" ${z1} ${good_z1} 0 0.001
checkreal "x2" ${x2} ${good_x2} 0 0.001
checkreal "y2" ${y2} ${good_y2} 0 0.001
checkreal "z2" ${z2} ${good_z2} 0 0.001
if {${x1_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : x1 is wrong"
set status 1
}
if {${y1_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : y1 is wrong"
set status 1
}
if {${z1_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : z1 is wrong"
set status 1
}
if {${x2_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : x2 is wrong"
set status 1
}
if {${y2_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : y2 is wrong"
set status 1
}
if {${z2_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : z2 is wrong"
set status 1
}
if { ${status} == 0 && ${exception_status} == 0&& ${e1_status} == 0 } {
if { ${exception_status} == 0 } {
puts "${BugNumber}: OK"
} else {
puts "${BugNumber}: Faulty"
@ -154,4 +87,3 @@ if { ${status} == 0 && ${exception_status} == 0&& ${e1_status} == 0 } {
checkview -display result -2d -path ${imagedir}/${test_image}.png
checkprops result -l 15.8888
checksection result

View File

@ -24,25 +24,15 @@ set good_AxisXList [list -0.0300865818651084 -0.941236271764613 0.53430666076168
set good_AxisYList [list 0.999547296325529 -0.337748842654791 -0.845290714645381 0.0533862206328518]
set good_AxisZList [list 0 0 0 0]
proc CalculatePercent {value good_value} {
if {${good_value} == 0. && ${value} == 0.} {
set percent 0.
} else {
set percent [expr abs(${value} - ${good_value}) / double(${good_value}) * 100.]
}
return ${percent}
}
if {[llength ${list}] != ${ll}} {
puts "Faulty OCC2755"
} else {
set percent_max 0.1
set IsGood 1
for {set i 0} {$i < ${ll}} {incr i} {
set dump_list [dump [lindex ${list} $i]]
regexp { *Parameters *: *([-0-9.+eE]+) *([-0-9.+eE]+)} $dump_list full Parameter1 Parameter2
regexp { *Origin *:([-0-9.+eE]+), *([-0-9.+eE]+), *([-0-9.+eE]+)} $dump_list full OriginX OriginY OriginZ
regexp { *Axis *:([-0-9.+eE]+), *([-0-9.+eE]+), *([-0-9.+eE]+)} $dump_list full AxisX AxisY AxisZ
regexp { *Parameters *: *([-0-9.+eE]+) *([-0-9.+eE]+)} $dump_list full Parameter1 Parameter2
regexp { *Origin *:([-0-9.+eE]+), *([-0-9.+eE]+), *([-0-9.+eE]+)} $dump_list full OriginX OriginY OriginZ
regexp { *Axis *:([-0-9.+eE]+), *([-0-9.+eE]+), *([-0-9.+eE]+)} $dump_list full AxisX AxisY AxisZ
set good_Parameter1 [lindex ${good_Parameter1List} $i]
set good_Parameter2 [lindex ${good_Parameter2List} $i]
@ -53,84 +43,13 @@ if {[llength ${list}] != ${ll}} {
set good_AxisY [lindex ${good_AxisYList} $i]
set good_AxisZ [lindex ${good_AxisZList} $i]
set Parameter1_percent [CalculatePercent ${Parameter1} ${good_Parameter1}]
set Parameter2_percent [CalculatePercent ${Parameter2} ${good_Parameter2}]
set OriginX_percent [CalculatePercent ${OriginX} ${good_OriginX}]
set OriginY_percent [CalculatePercent ${OriginY} ${good_OriginY}]
set OriginZ_percent [CalculatePercent ${OriginZ} ${good_OriginZ}]
set AxisX_percent [CalculatePercent ${AxisX} ${good_AxisX}]
set AxisY_percent [CalculatePercent ${AxisY} ${good_AxisY}]
set AxisZ_percent [CalculatePercent ${AxisZ} ${good_AxisZ}]
puts "good_Parameter1 = ${good_Parameter1}"
puts "Parameter1 = ${Parameter1}"
puts "Parameter1_percent = ${Parameter1_percent}\n"
puts "good_Parameter2 = ${good_Parameter2}"
puts "Parameter2 = ${Parameter2}"
puts "Parameter2_percent = ${Parameter2_percent}\n"
puts "good_OriginX = ${good_OriginX}"
puts "OriginX = ${OriginX}"
puts "OriginX_percent = ${OriginX_percent}\n"
puts "good_OriginY = ${good_OriginY}"
puts "OriginY = ${OriginY}"
puts "OriginY_percent = ${OriginY_percent}\n"
puts "good_OriginZ = ${good_OriginZ}"
puts "OriginZ = ${OriginZ}"
puts "OriginZ_percent = ${OriginZ_percent}\n"
puts "good_AxisX = ${good_AxisX}"
puts "AxisX = ${AxisX}"
puts "AxisX_percent = ${AxisX_percent}\n"
puts "good_AxisY = ${good_AxisY}"
puts "AxisY = ${AxisY}"
puts "AxisY_percent = ${AxisY_percent}\n"
puts "good_AxisZ = ${good_AxisZ}"
puts "AxisZ = ${AxisZ}"
puts "AxisZ_percent = ${AxisZ_percent}\n"
if {${Parameter1_percent} > ${percent_max}} {
puts "OCC2755 Faulty (case 3 / $i)"
set IsGood 0
}
if {${Parameter2_percent} > ${percent_max}} {
puts "OCC2755 Faulty (case 3 / $i)"
set IsGood 0
}
if {${OriginX_percent} > ${percent_max}} {
puts "OCC2755 Faulty (case 3 / $i)"
set IsGood 0
}
if {${OriginY_percent} > ${percent_max}} {
puts "OCC2755 Faulty (case 3 / $i)"
set IsGood 0
}
if {${OriginZ_percent} > ${percent_max}} {
puts "OCC2755 Faulty (case 3 / $i)"
set IsGood 0
}
if {${AxisX_percent} > ${percent_max}} {
puts "OCC2755 Faulty (case 3 / $i)"
set IsGood 0
}
if {${AxisY_percent} > ${percent_max}} {
puts "OCC2755 Faulty (case 3 / $i)"
set IsGood 0
}
if {${AxisZ_percent} > ${percent_max}} {
puts "OCC2755 Faulty (case 3 / $i)"
set IsGood 0
}
checkreal "Parameter1 / case 3 / $i" ${Parameter1} ${good_Parameter1} 0 0.001
checkreal "Parameter2 / case 3 / $i" ${Parameter2} ${good_Parameter2} 0 0.001
checkreal "OriginX / case 3 / $i" ${OriginX} ${good_OriginX} 0 0.001
checkreal "OriginY / case 3 / $i" ${OriginY} ${good_OriginY} 0 0.001
checkreal "OriginZ / case 3 / $i" ${OriginZ} ${good_OriginZ} 0 0.001
checkreal "AxisX / case 3 / $i" ${AxisX} ${good_AxisX} 0 0.001
checkreal "AxisY / case 3 / $i" ${AxisY} ${good_AxisY} 0 0.001
checkreal "AxisZ / case 3 / $i" ${AxisZ} ${good_AxisZ} 0 0.001
}
if {${IsGood} == 1} {
puts "OCC2755 OK"
}
}

View File

@ -8,18 +8,6 @@ puts ""
set BugNumber OCC6503
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}
}
plane pl 0 0 0 0 0 1
mkface f pl
set info_result [bounding f]
@ -38,43 +26,9 @@ set good_x2 1e+100
set good_y2 1e+100
set good_z2 9.9999999999999995e-08
set percent_max 0.1
set status 0
set x1_percent [GetPercent ${x1} ${good_x1}]
set y1_percent [GetPercent ${y1} ${good_y1}]
set z1_percent [GetPercent ${z1} ${good_z1}]
set x2_percent [GetPercent ${x2} ${good_x2}]
set y2_percent [GetPercent ${y2} ${good_y2}]
set z2_percent [GetPercent ${z2} ${good_z2}]
if {${x1_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : x1 is wrong"
set status 1
}
if {${y1_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : y1 is wrong"
set status 1
}
if {${z1_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : z1 is wrong"
set status 1
}
if {${x2_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : x2 is wrong"
set status 1
}
if {${y2_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : y2 is wrong"
set status 1
}
if {${z2_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : z2 is wrong"
set status 1
}
if { ${status} == 0 } {
puts "${BugNumber}: OK"
} else {
puts "${BugNumber}: Faulty"
}
checkreal "x1" ${x1} ${good_x1} 0 0.001
checkreal "y1" ${y1} ${good_y1} 0 0.001
checkreal "z1" ${z1} ${good_z1} 0 0.001
checkreal "x2" ${x2} ${good_x2} 0 0.001
checkreal "y2" ${y2} ${good_y2} 0 0.001
checkreal "z2" ${z2} ${good_z2} 0 0.001

View File

@ -32,17 +32,7 @@ intersect res_2 ll surf2
#set first2 [whatis res_1]
#set second2 [whatis res_2]
proc CalculatePercent {value good_value} {
if {${good_value} == 0. && ${value} == 0.} {
set percent 0.
} else {
set percent [expr abs(${value} - ${good_value}) / double(${good_value}) * 100.]
}
return ${percent}
}
set IsGood 1
set percent_max 0.1
if {[info exists res1] == 0} {
puts "Faulty OCC88 (case 2)"
set IsGood 0
@ -72,38 +62,7 @@ if {${IsGood} == 1} {
set y2 [lindex ${dump_list2} 12]
set z2 [lindex ${dump_list2} 14]
set x_percent [CalculatePercent ${x1} ${x2}]
set y_percent [CalculatePercent ${y1} ${y2}]
set z_percent [CalculatePercent ${z1} ${z2}]
puts "x1 = ${x1}"
puts "x2 = ${x2}"
puts "x_percent = ${x_percent}\n"
puts "y1 = ${y1}"
puts "y2 = ${y2}"
puts "y_percent = ${y_percent}\n"
puts "z1 = ${z1}"
puts "z2 = ${z2}"
puts "z_percent = ${z_percent}\n"
if {${x_percent} > ${percent_max}} {
puts "OCC88 Faulty (case 6)"
set IsGood 0
}
if {${y_percent} > ${percent_max}} {
puts "OCC88 Faulty (case 7)"
set IsGood 0
}
if {${z_percent} > ${percent_max}} {
puts "OCC88 Faulty (case 8)"
set IsGood 0
}
checkreal "x1 case 6" ${x1} ${x2} 0 0.001
checkreal "y1 case 7" ${y1} ${y2} 0 0.001
checkreal "z1 case 8" ${z1} ${z2} 0 0.001
}
if {${IsGood} == 1} {
puts "OCC88 OK"
}

View File

@ -8,18 +8,6 @@ puts ""
set BugNumber OCC9303
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}
}
cone c 0 0 0 30 0
trimv nc c 20 30
@ -69,7 +57,6 @@ if { $mistake == 0} {
set x2 [string range ${x2} 0 end-1]
set y2 [string range ${y2} 0 end-1]
set percent_max 0.1
set GoodX1 1.154700538379251e+01
set GoodY1 0.000000000000000e+00
set GoodZ1 2.000000000000000e+01
@ -77,30 +64,12 @@ if { $mistake == 0} {
set GoodY2 0.000000000000000e+00
set GoodZ2 2.000000000000000e+01
set Percent_x1 [GetPercent ${x1} ${GoodX1}]
set Percent_y1 [GetPercent ${y1} ${GoodY1}]
set Percent_z1 [GetPercent ${z1} ${GoodZ1}]
set Percent_x2 [GetPercent ${x2} ${GoodX2}]
set Percent_y2 [GetPercent ${y2} ${GoodY2}]
set Percent_z2 [GetPercent ${z2} ${GoodZ2}]
if {${Percent_x1} > ${percent_max}} {
puts "Faulty ${BugNumber}: bad value of x1 = ${x1}"
} elseif {${Percent_y1} > ${percent_max}} {
puts "Faulty ${BugNumber}: bad value of y1 = ${y1}"
} elseif {${Percent_z1} > ${percent_max}} {
puts "Faulty ${BugNumber}: bad value of z1 = ${z1}"
} elseif {${Percent_x2} > ${percent_max}} {
puts "Faulty ${BugNumber}: bad value of x2 = ${x2}"
} elseif {${Percent_y2} > ${percent_max}} {
puts "Faulty ${BugNumber}: bad value of y2 = ${y2}"
} elseif {${Percent_z2} > ${percent_max}} {
puts "Faulty ${BugNumber}: bad value of z2 = ${z2}"
} else {
puts "${BugNumber}: OK"
}
checkreal "x1" ${x1} ${GoodX1} 0 0.001
checkreal "y1" ${y1} ${GoodY1} 0 0.001
checkreal "z1" ${z1} ${GoodZ1} 0 0.001
checkreal "x2" ${x2} ${GoodX2} 0 0.001
checkreal "y2" ${y2} ${GoodY2} 0 0.001
checkreal "z2" ${z2} ${GoodZ2} 0 0.001
}
} else {
puts "Faulty ${BugNumber} : intersection does not finished"

View File

@ -1,15 +1,3 @@
pload XDE
set subgroup xde
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}
}

View File

@ -10,8 +10,6 @@ set BugNumber OCC6542
set TheFileName OCC6542.igs
set TheFileName2 ${TheFileName}-2.igs
set percent_max 0.1
igesbrep [locate_data_file ${TheFileName}] a *
set comp [tpcompound res1]
@ -28,8 +26,8 @@ if {$index > -1} {
set index1 [lsearch -exact ${dumpList} Circle]
if {${index1} == -1} {
puts "Faulty ${BugNumber} : there is not a cirle in source file"
incr status
puts "Faulty ${BugNumber} : there is not a cirle in source file"
incr status
} else {
puts "OK ${BugNumber} : there is a cirle in source file"
set Center_X_1 [lindex ${dumpList} [expr ${index1} + 5]]
@ -64,136 +62,76 @@ if {$index > -1} {
dall
if [catch { igesbrep ${imagedir}/${TheFileName2} b * } res] {
puts "Error ${BugNumber}: there is reading problem"
puts "Error ${BugNumber}: there is reading problem"
} else {
set comp [tpcompound res]
set comp [tpcompound res]
set result [checkshape res]
set index [lsearch $result Faulty]
if {$index > -1} {
puts "Faulty ${BugNumber} : checkshape is wrong for writing file"
incr status
puts "Faulty ${BugNumber} : checkshape is wrong for writing file"
incr status
} else {
puts "OK ${BugNumber} : checkshape is good for writing file"
puts "OK ${BugNumber} : checkshape is good for writing file"
set dumpList2 [split [dump res] "\n\t :,"]
set index2 [lsearch -exact ${dumpList2} Circle]
set dumpList2 [split [dump res] "\n\t :,"]
set index2 [lsearch -exact ${dumpList2} Circle]
if {${index2} == -1} {
puts "Faulty ${BugNumber} : there is not a cirle in writing file"
incr status
} else {
puts "OK ${BugNumber} : there is a cirle in writing file"
set Center_X_2 [lindex ${dumpList2} [expr ${index2} + 5]]
set Center_Y_2 [lindex ${dumpList2} [expr ${index2} + 7]]
set Center_Z_2 [lindex ${dumpList2} [expr ${index2} + 9]]
set Axis_X_2 [lindex ${dumpList2} [expr ${index2} + 17]]
set Axis_Y_2 [lindex ${dumpList2} [expr ${index2} + 19]]
set Axis_Z_2 [lindex ${dumpList2} [expr ${index2} + 21]]
set XAxis_X_2 [lindex ${dumpList2} [expr ${index2} + 28]]
set XAxis_Y_2 [lindex ${dumpList2} [expr ${index2} + 30]]
set XAxis_Z_2 [lindex ${dumpList2} [expr ${index2} + 32]]
set YAxis_X_2 [lindex ${dumpList2} [expr ${index2} + 39]]
set YAxis_Y_2 [lindex ${dumpList2} [expr ${index2} + 41]]
set YAxis_Z_2 [lindex ${dumpList2} [expr ${index2} + 43]]
set Radius_2 [lindex ${dumpList2} [expr ${index2} + 49]]
puts "Center_X_2 = ${Center_X_2}"
puts "Center_Y_2 = ${Center_Y_2}"
puts "Center_Z_2 = ${Center_Z_2}"
puts "Axis_X_2 = ${Axis_X_2}"
puts "Axis_Y_2 = ${Axis_Y_2}"
puts "Axis_Z_2 = ${Axis_Z_2}"
puts "XAxis_X_2 = ${XAxis_X_2}"
puts "XAxis_Y_2 = ${XAxis_Y_2}"
puts "XAxis_Z_2 = ${XAxis_Z_2}"
puts "YAxis_X_2 = ${YAxis_X_2}"
puts "YAxis_Y_2 = ${YAxis_Y_2}"
puts "YAxis_Z_2 = ${YAxis_Z_2}"
puts "Radius_2 = ${Radius_2}"
if {${index2} == -1} {
puts "Faulty ${BugNumber} : there is not a cirle in writing file"
incr status
} else {
puts "OK ${BugNumber} : there is a cirle in writing file"
set Center_X_2 [lindex ${dumpList2} [expr ${index2} + 5]]
set Center_Y_2 [lindex ${dumpList2} [expr ${index2} + 7]]
set Center_Z_2 [lindex ${dumpList2} [expr ${index2} + 9]]
set Axis_X_2 [lindex ${dumpList2} [expr ${index2} + 17]]
set Axis_Y_2 [lindex ${dumpList2} [expr ${index2} + 19]]
set Axis_Z_2 [lindex ${dumpList2} [expr ${index2} + 21]]
set XAxis_X_2 [lindex ${dumpList2} [expr ${index2} + 28]]
set XAxis_Y_2 [lindex ${dumpList2} [expr ${index2} + 30]]
set XAxis_Z_2 [lindex ${dumpList2} [expr ${index2} + 32]]
set YAxis_X_2 [lindex ${dumpList2} [expr ${index2} + 39]]
set YAxis_Y_2 [lindex ${dumpList2} [expr ${index2} + 41]]
set YAxis_Z_2 [lindex ${dumpList2} [expr ${index2} + 43]]
set Radius_2 [lindex ${dumpList2} [expr ${index2} + 49]]
puts "Center_X_2 = ${Center_X_2}"
puts "Center_Y_2 = ${Center_Y_2}"
puts "Center_Z_2 = ${Center_Z_2}"
puts "Axis_X_2 = ${Axis_X_2}"
puts "Axis_Y_2 = ${Axis_Y_2}"
puts "Axis_Z_2 = ${Axis_Z_2}"
puts "XAxis_X_2 = ${XAxis_X_2}"
puts "XAxis_Y_2 = ${XAxis_Y_2}"
puts "XAxis_Z_2 = ${XAxis_Z_2}"
puts "YAxis_X_2 = ${YAxis_X_2}"
puts "YAxis_Y_2 = ${YAxis_Y_2}"
puts "YAxis_Z_2 = ${YAxis_Z_2}"
puts "Radius_2 = ${Radius_2}"
set Center_X_percent [GetPercent ${Center_X_2} ${Center_X_1}]
set Center_Y_percent [GetPercent ${Center_Y_2} ${Center_Y_1}]
set Center_Z_percent [GetPercent ${Center_Z_2} ${Center_Z_1}]
checkreal "Center_X" ${Center_X_2} ${Center_X_1} 0 0.001
checkreal "Center_Y" ${Center_Y_2} ${Center_Y_1} 0 0.001
checkreal "Center_Z" ${Center_Z_2} ${Center_Z_1} 0 0.001
set Axis_X_percent [GetPercent ${Axis_X_2} ${Axis_X_1}]
set Axis_Y_percent [GetPercent ${Axis_Y_2} ${Axis_Y_1}]
set Axis_Z_percent [GetPercent ${Axis_Z_2} ${Axis_Z_1}]
checkreal "Axis_X" ${Axis_X_2} ${Axis_X_1} 0 0.001
checkreal "Axis_Y" ${Axis_Y_2} ${Axis_Y_1} 0 0.001
checkreal "Axis_Z" ${Axis_Z_2} ${Axis_Z_1} 0 0.001
set XAxis_X_percent [GetPercent ${XAxis_X_2} ${XAxis_X_1}]
set XAxis_Y_percent [GetPercent ${XAxis_Y_2} ${XAxis_Y_1}]
set XAxis_Z_percent [GetPercent ${XAxis_Z_2} ${XAxis_Z_1}]
checkreal "XAxis_X" ${XAxis_X_2} ${XAxis_X_1} 0 0.001
checkreal "XAxis_Y" ${XAxis_Y_2} ${XAxis_Y_1} 0 0.001
checkreal "XAxis_Z" ${XAxis_Z_2} ${XAxis_Z_1} 0 0.001
set YAxis_X_percent [GetPercent ${YAxis_X_2} ${YAxis_X_1}]
set YAxis_Y_percent [GetPercent ${YAxis_Y_2} ${YAxis_Y_1}]
set YAxis_Z_percent [GetPercent ${YAxis_Z_2} ${YAxis_Z_1}]
checkreal "YAxis_X" ${YAxis_X_2} ${YAxis_X_1} 0 0.001
checkreal "YAxis_Y" ${YAxis_Y_2} ${YAxis_Y_1} 0 0.001
checkreal "YAxis_Z" ${YAxis_Z_2} ${YAxis_Z_1} 0 0.001
set Radius_percent [GetPercent ${Radius_2} ${Radius_1}]
if {${Center_X_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : Center_X is wrong"
incr status
}
if {${Center_Y_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : Center_Y is wrong"
incr status
}
if {${Center_Z_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : Center_Z is wrong"
incr status
}
if {${Axis_X_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : Axis_X is wrong"
incr status
}
if {${Axis_Y_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : Axis_Y is wrong"
incr status
}
if {${Axis_Z_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : Axis_Z is wrong"
incr status
}
if {${XAxis_X_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : XAxis_X is wrong"
incr status
}
if {${XAxis_Y_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : XAxis_Y is wrong"
incr status
}
if {${XAxis_Z_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : XAxis_Z is wrong"
incr status
}
if {${YAxis_X_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : YAxis_X is wrong"
incr status
}
if {${YAxis_Y_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : YAxis_Y is wrong"
incr status
}
if {${YAxis_Z_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : YAxis_Z is wrong"
incr status
}
if {${Radius_percent} > ${percent_max}} {
puts "Faulty ${BugNumber} : Radius is wrong"
incr status
}
}
checkreal "Radius" ${Radius_2} ${Radius_1} 0 0.001
}
}
}
}
puts ""
if {${status} == 0} {
puts "${BugNumber}: OK"
} else {
if {${status} != 0} {
puts "${BugNumber}: Error"
}

View File

@ -32,24 +32,14 @@ if { ${IsOk} == 1} {
set aTokList {= }
set Tol1 [lindex [split [tolerance OCC9490a] ${aTokList}] 2]
set Tol2 [lindex [split [tolerance OCC9490b] ${aTokList}] 2]
set percent_max 0.1
set Tolerance_percent [GetPercent ${Tol1} ${Tol2}]
puts "Tolerance_percent = ${Tolerance_percent} %"
if { ${Tolerance_percent} > ${percent_max} } {
set IsOk 0
}
checkreal "Tolerance" ${Tol1} ${Tol2} 0 0.001
checknbshapes OCC9490a -vertex 1770 -edge 1237 -wire 140 -face 123 -shell 0 -solid 0 -compsolid 0 -compound 1 -shape 3271
checkprops OCC9490a -s 36259
checknbshapes OCC9490b -vertex 1770 -edge 1237 -wire 140 -face 123 -shell 0 -solid 0 -compsolid 0 -compound 1 -shape 3271
checkprops OCC9490b -s 36259
if { ${IsOk} == 0 } {
puts "${BugNumber}: Faulty"
} else {
puts "${BugNumber}: OK"
}
}
renamevar OCC9490b result

View File

@ -34,23 +34,12 @@ if { ${IsOk} == 1} {
set aTokList {= }
set Tol1 [lindex [split [tolerance OCC9531a] ${aTokList}] 2]
set Tol2 [lindex [split [tolerance OCC9531b] ${aTokList}] 2]
set percent_max 0.1
set Tolerance_percent [GetPercent ${Tol1} ${Tol2}]
puts "Tolerance_percent = ${Tolerance_percent} %"
if { ${Tolerance_percent} > ${percent_max} } {
set IsOk 0
}
checkreal "Tolerance" ${Tol1} ${Tol2} 0 0.001
checknbshapes OCC9531a -vertex 5748 -edge 5680 -wire 915 -face 899 -shell 0 -solid 0 -compsolid 0 -compound 1 -shape 13243
checkprops OCC9531a -s 5236.89
checkprops OCC9531b -s 5236.89
checknbshapes OCC9531b -vertex 5748 -edge 5680 -wire 915 -face 899 -shell 0 -solid 0 -compsolid 0 -compound 1 -shape 13243
if { ${IsOk} == 0 } {
puts "${BugNumber}: Faulty"
} else {
puts "${BugNumber}: OK"
}
}
renamevar OCC9531b result