}
}
+ if { ${compared_equal_shape} == -1 && ${compared_notequal_shape} == -1 } {
+ 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 area 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"
+ }
+ }
+ }
+}
+
+help checkdump {
+ Procedure includes command to parse output dump and compare it with reference values.
+
+ Use: checkdump shapename [options...]
+ Allowed options are:
+ -name NAME: list of parsing parameters (e.g. Center, Axis, etc)
+ -ref VALUE: list of reference values for each parameter in NAME
+ -eps EPSILON: the epsilon defines relative precision of computation
+}
+
+proc checkdump {shape args} {
+ puts "checkdump ${shape} ${args}"
+ upvar ${shape} ${shape}
+
+ set ddump -1
+ set epsilon -1
+ set options {{"-name" params 1}
+ {"-ref" ref 1}
+ {"-eps" epsilon 1}
+ {"-dump" ddump 1}}
+
+ if { ${ddump} == -1 } {
+ set ddump [dump ${shape}]
+ }
+ _check_args ${args} ${options} "checkdump"
+
+ set index 0
+ foreach param ${params} {
+ set pattern "${param}\\s*:\\s*"
+ set number_pattern "(\[-0-9.+eE\]+)\\s*"
+ set ref_values ""
+ set local_ref ${ref}
+ if { [llength ${params}] > 1 } {
+ set local_ref [lindex ${ref} ${index}]
+ }
+ foreach item ${local_ref} {
+ if { ![regexp "$pattern$number_pattern" $ddump full res] } {
+ puts "Error: cheked parameter ${param} is not listed in dump"
+ break
+ }
+ lappend ref_values $res
+ set pattern "${pattern}${res},\\s*"
+ ## without precision
+ if { ${epsilon} == -1 } {
+ if { ${item} != ${res} } {
+ puts "Error: parameter ${param} - current value (${res}) is not equal to reference value (${item})"
+ } else {
+ puts "OK: parameter ${param} - current value (${res}) is equal to reference value (${item})"
+ }
+ ## with precision
+ } else {
+ set precision 0.0000001
+ if { ( abs($res) > $precision ) || ( abs($item) > $precision ) } {
+ if { ($item != 0 && [expr 1.*abs($item - $res)/$item] > $epsilon) || ($item == 0 && $res != 0) } {
+ puts "Error: The $param of the resulting shape is $res and the expected $param is $item"
+ } else {
+ puts "OK: parameter ${param} - current value (${res}) is equal to reference value (${item})"
+ }
+ }
+ }
+ }
+ incr index
+ }
+}
+
+help checklength {
+ Procedure includes commands to compute length of input shape.
+
+ Use: checklength shapename [options...]
+ Allowed options are:
+ -l LENGTH: command length, computes the length of input curve with precision of computation
+ -eps EPSILON: the epsilon defines relative precision of computation
+ -equal SHAPE: compare length of input shapes. Puts error if its are not equal
+ -notequal SHAPE: compare length of input shapes. Puts error if its are equal
+}
+
+proc checklength {shape args} {
+ puts "checklength ${shape} ${args}"
+ upvar ${shape} ${shape}
+
+ if {![isdraw ${shape}] || [regexp "${shape} is a \n" [whatis ${shape}]]} {
+ puts "Error: The command cannot be built"
+ return
+ }
+
+ set length -1
+ set epsilon 1.0e-4
+ set compared_equal_shape -1
+ set compared_notequal_shape -1
+ set equal_check 0
+
+ set options {{"-eps" epsilon 1}
+ {"-equal" compared_equal_shape 1}
+ {"-notequal" compared_notequal_shape 1}}
+
+ if { [regexp {\-[not]*equal} $args] } {
+ lappend options {"-l" length 0}
+ set equal_check 1
+ } else {
+ lappend options {"-l" length 1}
+ }
+ _check_args ${args} ${options} "checkprops"
+
+ if { ${length} != -1 || ${equal_check} == 1 } {
+ set CommandName length
+ set mass $length
+ set prop "length"
+ set equal_check 0
+ }
+
+ regexp "The +length+ ${shape} +is +(\[-0-9.+eE\]+)" [${CommandName} ${shape} ${epsilon}] full m
+
+ if { ${compared_equal_shape} != -1 } {
+ upvar ${compared_equal_shape} ${compared_equal_shape}
+ regexp "The +length+ ${compared_equal_shape} +is +(\[-0-9.+eE\]+)" [${CommandName} ${compared_equal_shape} ${epsilon}] full compared_m
+ if { $compared_m != $m } {
+ puts "Error: length of shape ${compared_equal_shape} is not equal to shape ${shape}"
+ }
+ }
+
+ if { ${compared_notequal_shape} != -1 } {
+ upvar ${compared_notequal_shape} ${compared_notequal_shape}
+ regexp regexp "The +length+ ${compared_notequal_shape} +is +(\[-0-9.+eE\]+)" [${CommandName} ${compared_notequal_shape} ${epsilon}] full compared_m
+ if { $compared_m == $m } {
+ puts "Error: length of shape ${compared_notequal_shape} is equal shape to ${shape}"
+ }
+ }
+
if { ${compared_equal_shape} == -1 && ${compared_notequal_shape} == -1 } {
if { [string compare "$mass" "empty"] != 0 } {
if { $m == 0 } {
pload XSDRAW
2dbsplinecurve cc 3 2 0 4 1 4 -1 -1 1 0 -1 1 0 0 1 0 0 1
offset2dcurve o cc .5
-set info [length o]
-regexp {The length o is+ +([-0-9.+eE]+)} $info full ll
-set ll_check 2.3717833300483151
-
-if { [expr 1.*abs($ll_check - $ll)/$ll_check] > 0.01 } {
- puts "Error : The lenght of result shape is $ll"
-}
+checklength o -l 2.3717833300483151
\ No newline at end of file
bsplinecurve cc 3 2 0 4 1 4 -1 -1 2 1 0 -1 2 1 0 0 2 1 0 0 2 1
point pp 0 0 1
offsetcurve o cc .5 pp
-set info [length o]
-regexp {The length o is+ +([-0-9.+eE]+)} $info full ll
-set ll_check 2.3717833300483151
-
-if { [expr 1.*abs($ll_check - $ll)/$ll_check] > 0.01 } {
- puts "Error : The lenght of result shape is $ll"
-}
+checklength o -l 2.3717833300483151
\ No newline at end of file
pload XSDRAW
2dbsplinecurve c1 2 5 0 3 0.2 1 0.3 1 0.4 1 0.5 3 2 0 1 3 -1 1 5 5 1 5 5 1 6 8 1 4 7 1
offset2dcurve o1 c1 2
-
-set info [length o1]
-regexp {The length o1 is+ +([-0-9.+eE]+)} $info full ll
-set ll_check 19.244437838214424
-
-if { [expr 1.*abs($ll_check - $ll)/$ll_check] > 0.01 } {
- puts "Error : The lenght of result shape is $ll"
-}
+checklength o1 -l 19.244437838214424
\ No newline at end of file
restore [locate_data_file bug24643_b1.brep] b1
restore [locate_data_file bug24643_b2.brep] b2
-
bopcurves b1 b2
-
-regexp {The length c_1 is ([-0-9.+eE]+)} [length c_1] full Curve_Length
-
-set expected_length 107.39085794960783
-set tol_abs_length 1.e-3
-set tol_rel_length 0.01
-checkreal "Curve length" ${Curve_Length} ${expected_length} ${tol_abs_length} ${tol_rel_length}
+checklength c_1 -l 107.39085794960783
set log [dump c_1]
if {[regexp {Trimmed +curve} ${log}]} {
if {${Toler} > ${MaxTol}} {
puts "Error: Tolerance is too big!"
}
-
-regexp {The length c_1 is ([-0-9.+eE]+)} [length c_1] full Curve_Length
-
-set expected_length 0.52377379499528021
-set tol_abs_length 1.e-7
-set tol_rel_length 0.01
-checkreal "Curve length" ${Curve_Length} ${expected_length} ${tol_abs_length} ${tol_rel_length}
+checklength c_1 -l 0.52377379499528021
# 2. BOP
bclearobjects
if {${Toler} > ${MaxTol}} {
puts "Error: Tolerance is too big!"
}
-
-regexp {The length c_1 is ([-0-9.+eE]+)} [length c_1] full Curve_Length
-
-set expected_length 1.614
-set tol_abs_length 1.e-3
-set tol_rel_length 0.01
-checkreal "Curve length" ${Curve_Length} ${expected_length} ${tol_abs_length} ${tol_rel_length}
+checklength c_1 -l 1.614
smallview
donly c_1 b1
bop h0 f0
bopsection result
-
-set length 145.692
+checkprops result -l 142.264
set nbshapes_expected "
Number of shapes in shape
if {${NbCurv} != ${GoodNbCurv}} {
puts "Error: Curve Number is bad!"
}
-
-set expL1 3.0
-set expL2 3.0
-
-regexp {The length c_1 is ([-0-9.+eE]+)} [length c_1] full ll1
-regexp {The length c_2 is ([-0-9.+eE]+)} [length c_2] full ll2
-
-checkreal "length c_1 " ${ll1} $expL1 0.0 1.0e-6
-checkreal "length c_2 " ${ll2} $expL1 0.0 1.0e-6
+checklength c_1 -l 3.0
+checklength c_2 -l 3.0
axo
donly f* c_*
point p 1600 300
line l 0 500 2000 500
cirtang c p l 400
-
-set info1 [length $c_1]
-set info2 [length $c_2]
-regexp {The length c_1 is +([-0-9.+eE]+)} $info1 full len1
-regexp {The length c_2 is +([-0-9.+eE]+)} $info2 full len2
-set len_int1 [expr int($len1)]
-set len_int2 [expr int($len2)]
-
-if { ${len_int1} != ${len_ch} || ${len_int2} != ${len_ch} } {
- puts "Error : Length is invalid"
-}
+checklength c_1 -l 2513.2741228718346
+checklength c_2 -l 2513.2741228718346
\ No newline at end of file
puts "It takes visual check for this BUG"
puts "=================================="
puts ""
-set len_ch1 3568
-set len_ch2 9964
-set len_ch3 2082
-set len_ch4 32696
-set len_ch5 1681
-set len_ch6 3097
-set len_ch7 1545
-set len_ch8 772
circle c1 0 0 100
circle c2 500 -400 300
circle c3 300 200 200
cirtang result c1 c2 c3
-
-set info1 [length $result_1]
-set info2 [length $result_2]
-set info3 [length $result_3]
-set info4 [length $result_4]
-set info5 [length $result_5]
-set info6 [length $result_6]
-set info7 [length $result_7]
-set info8 [length $result_8]
-
-regexp {The length result_1 is +([-0-9.+eE]+)} $info1 full len1
-regexp {The length result_2 is +([-0-9.+eE]+)} $info2 full len2
-regexp {The length result_3 is +([-0-9.+eE]+)} $info3 full len3
-regexp {The length result_4 is +([-0-9.+eE]+)} $info4 full len4
-regexp {The length result_5 is +([-0-9.+eE]+)} $info5 full len5
-regexp {The length result_6 is +([-0-9.+eE]+)} $info6 full len6
-regexp {The length result_7 is +([-0-9.+eE]+)} $info7 full len7
-regexp {The length result_8 is +([-0-9.+eE]+)} $info8 full len8
-
-set len_int1 [expr int($len1)]
-set len_int2 [expr int($len2)]
-set len_int3 [expr int($len3)]
-set len_int4 [expr int($len4)]
-set len_int5 [expr int($len5)]
-set len_int6 [expr int($len6)]
-set len_int7 [expr int($len7)]
-set len_int8 [expr int($len8)]
-
-if { ${len_int1} != ${len_ch1}
- || ${len_int2} != ${len_ch2}
- || ${len_int3} != ${len_ch3}
- || ${len_int4} != ${len_ch4}
- || ${len_int5} != ${len_ch5}
- || ${len_int6} != ${len_ch6}
- || ${len_int7} != ${len_ch7}
- || ${len_int8} != ${len_ch8} } {
- puts "Error : Length is invalid"
-}
+checklength result_1 -l 3568.9587306060739
+checklength result_2 -l 9964.7111736227271
+checklength result_3 -l 2082.9371204466097
+checklength result_4 -l 32696.069757517998
+checklength result_5 -l 1681.9298517645602
+checklength result_6 -l 3097.3731840080009
+checklength result_7 -l 1545.2428620020787
+checklength result_8 -l 772.26646380656518
\ No newline at end of file
puts "=================================="
puts ""
-set len_ch1 2513
-set len_ch2 837
-set len_ch3 279
-
circle c1 500 1800 500
circle c2 500 1900 400
circle c3 700 1900 200
-cirtang result c1 c2 c3
-
-set info1 [length $result_1]
-set info2 [length $result_2]
-set info3 [length $result_3]
-regexp {The length result_1 is +([-0-9.+eE]+)} $info1 full len1
-regexp {The length result_2 is +([-0-9.+eE]+)} $info2 full len2
-regexp {The length result_3 is +([-0-9.+eE]+)} $info3 full len3
-set len_int1 [expr int($len1)]
-set len_int2 [expr int($len2)]
-set len_int3 [expr int($len3)]
+cirtang result c1 c2 c3
-if { ${len_int1} != ${len_ch1}
- || ${len_int2} != ${len_ch2}
- || ${len_int3} != ${len_ch3} } {
- puts "Error : Length is invalid"
-}
+checklength result_1 -l 2513.2741228703289
+checklength result_2 -l 837.75804095727631
+checklength result_3 -l 279.2526803190928
\ No newline at end of file
puts "=================================="
puts ""
-set len_ch1 1570
-set len_ch2 785
-set len_ch3 785
-set len_ch4 523
-set len_ch5 523
-
circle c3 500 3000 250
circle c2 375 3000 125
circle c1 625 3000 125
cirtang result c1 c2 c3
-set info1 [length $result_1]
-set info2 [length $result_2]
-set info3 [length $result_3]
-set info4 [length $result_4]
-set info5 [length $result_5]
-
-regexp {The length result_1 is +([-0-9.+eE]+)} $info1 full len1
-regexp {The length result_2 is +([-0-9.+eE]+)} $info2 full len2
-regexp {The length result_3 is +([-0-9.+eE]+)} $info3 full len3
-regexp {The length result_4 is +([-0-9.+eE]+)} $info4 full len4
-regexp {The length result_5 is +([-0-9.+eE]+)} $info5 full len5
-
-set len_int1 [expr int($len1)]
-set len_int2 [expr int($len2)]
-set len_int3 [expr int($len3)]
-set len_int4 [expr int($len4)]
-set len_int5 [expr int($len5)]
-
-if { ${len_int1} != ${len_ch1}
- || ${len_int2} != ${len_ch2}
- || ${len_int3} != ${len_ch3}
- || ${len_int4} != ${len_ch4}
- || ${len_int5} != ${len_ch5} } {
- puts "Error : Length is invalid"
-}
-
+checklength result_1 -l 1570.7963267948965
+checklength result_2 -l 785.39816339744868
+checklength result_3 -l 785.39816339744823
+checklength result_4 -l 523.59877559829806
+checklength result_5 -l 523.59877559829806
\ No newline at end of file
ellipse test_ellipse 460 0 150 100
BUC60843 result test_circle test_ellipse 0.1
-
-set info [length $result]
-regexp {The length result is +([-0-9.+eE]+)} $info full len
-
-if { ${len} != ${len_ch} } {
- puts "Error : length is invalid"
-}
+checklength result -l 4.0000000000000001e+100
\ No newline at end of file
ellipse test_ellipse_2 460 0 150 100
BUC60843 result test_ellipse_1 test_ellipse_2 1.0 1.0
-
-set info [length $result]
-regexp {The length result is +([-0-9.+eE]+)} $info full len
-
-if { ${len} != ${len_ch} } {
- puts "Error : length is invalid"
-}
-
+checklength result -l 4.0000000000000001e+100
\ No newline at end of file
restore [locate_data_file buc60965-s.draw] s
project result c s
-
-regexp {The+ length+ result+ is +([-0-9.+eE]+)} [length result] full len
-set y [expr 3.e5+int(1.e5*($len-round($len)))]
-
-if { $y != 314196.0 } {
- puts "Results is incorrect"
-}
+checklength result -l 3.141968717040271
set 2dviewer 0
# Extrema problems. Case: one of the Extrema arguments is an infinite face or an infinite edge.
###########################################################
-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 OCC12522
-
restore [locate_data_file OCC12522.brep] arc1
explode arc1 e
mkcurve curve1 arc1_1
-
plane plane1 6400 -4000 -160 0 0 1 1 0 0
-
extrema curve1 plane1
-set percent_max 0.1
-set good_length 2.9009126041478908
-
-set ext_1_length [lindex [length ext_1] 4]
-
-set length_percent [GetPercent ${ext_1_length} ${good_length}]
-puts "length_percent = ${length_percent}"
-
-if {${length_percent} > ${percent_max}} {
- puts "${BugNumber}: Faulty"
-} else {
- puts "${BugNumber}: OK"
-}
+checklength ext_1 -l 2.9009126041478908
\ No newline at end of file
set len_expected 4.e100
line line_2d 0 0 1 1
-
offset result line_2d 10 1 0
-set info [length $result]
-regexp {The length result is +([-0-9.+eE]+)} $info full len
-
-checkreal "Length" $len $len_expected 0. 1e-10
+checklength result -l 4.e100
\ No newline at end of file
# Projection algorithm produces wrong results.
#######################################################################
-set BugNumber OCC23201
-
-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 bug23201_Tool_1.brep] b2
restore [locate_data_file bug23201_Tool_2.brep] b3
explode b3 e
mkcurve c3 b3_2
-set BugStatus 0
-
-set percent_max 0.1
-set good_c23 3.1415926535897922
-set good_c32 3.1415926535897922
-
-if [catch { project c23 c2 s3 } ] {
- set BugStatus 1
-} else {
- set c23_length [lindex [length c23] end]
- set length_percent [GetPercent ${c23_length} ${good_c23}]
- puts "length_percent = ${length_percent}"
- if {${length_percent} > ${percent_max}} {
- puts "c23: Faulty"
- set BugStatus 1
- } else {
- puts "c23: OK"
- }
-}
-
-if [catch { project c32 c3 s2 } ] {
- set BugStatus 1
-} else {
- set c32_length [lindex [length c32] end]
- set length_percent [GetPercent ${c32_length} ${good_c32}]
- puts "length_percent = ${length_percent}"
- if {${length_percent} > ${percent_max}} {
- puts "c32: Faulty"
- set BugStatus 1
- } else {
- puts "c32: OK"
- }
-}
-
-# Resume
-puts ""
-if { ${BugStatus} != 0 } {
- puts "Faulty ${BugNumber}"
-} else {
- puts "OK ${BugNumber}"
-}
+project c23 c2 s3
+checklength c23 -l 3.1415926535897922
+project c32 c3 s2
+checklength c32 -l 3.1415926535897922
\ No newline at end of file
# Projection algorithm produces wrong results
##########################################################################################################
-set int_check 3
-set fract_check 1415927
-
restore [locate_data_file bug23464_c41.draw] c41
restore [locate_data_file bug23464_s46.draw] s46
project result c41 s46
-set info [length result]
-regexp {is +([-0-9.+eE]+)} $info full num
-
-set int_part [expr round($num)]
-set y [expr $num - round($num)]
-set z [expr $y*10000000]
-set fract_part [expr round($z)]
-
-if { ${int_check} != ${int_part} } {
- puts "Error : Integer part of result is incorrect"
-}
-
-if { ${fract_check} != ${fract_part} } {
- puts "Error : Fractional part of result is incorrect"
-}
-
-
-
-
-
+checklength result -l 3.1415926535898007
\ No newline at end of file
# Projection algorithm produces wrong results
##########################################################################################################
-set int_check 3
-set fract_check 1415927
-
restore [locate_data_file bug23464_c50.draw] c50
restore [locate_data_file bug23464_s37.draw] s37
project result c50 s37
-set info [length result]
-regexp {is +([-0-9.+eE]+)} $info full num
-
-set int_part [expr round($num)]
-set y [expr $num - round($num)]
-set z [expr $y*10000000]
-set fract_part [expr round($z)]
-
-if { ${int_check} != ${int_part} } {
- puts "Error : Integer part of result is incorrect"
-}
-
-if { ${fract_check} != ${fract_part} } {
- puts "Error : Fractional part of result is incorrect"
-}
-
-
-
-
-
+checklength result -l 3.1415926535898002
\ No newline at end of file
# Projection algorithm produces wrong results
##########################################################################################################
-set int_check 3
-set fract_check 1415927
-
restore [locate_data_file bug23464_c57.draw] c57
restore [locate_data_file bug23464_s37.draw] s37
project result c57 s37
-set info [length result]
-regexp {is +([-0-9.+eE]+)} $info full num
-
-set int_part [expr round($num)]
-set y [expr $num - round($num)]
-set z [expr $y*10000000]
-set fract_part [expr round($z)]
-
-if { ${int_check} != ${int_part} } {
- puts "Error : Integer part of result is incorrect"
-}
-
-if { ${fract_check} != ${fract_part} } {
- puts "Error : Fractional part of result is incorrect"
-}
-
-
-
-
-
+checklength result -l 3.1415926535897993
\ No newline at end of file
# Projection algorithm produces wrong results
##########################################################################################################
-set int_check 3
-set fract_check 1415927
-
restore [locate_data_file bug23464_c58.draw] c58
restore [locate_data_file bug23464_s37.draw] s37
project result c58 s37
-set info [length result]
-regexp {is +([-0-9.+eE]+)} $info full num
-
-set int_part [expr round($num)]
-set y [expr $num - round($num)]
-set z [expr $y*10000000]
-set fract_part [expr round($z)]
-
-if { ${int_check} != ${int_part} } {
- puts "Error : Integer part of result is incorrect"
-}
-
-if { ${fract_check} != ${fract_part} } {
- puts "Error : Fractional part of result is incorrect"
-}
-
-
-
-
-
+checklength result -l 3.1415926535898038
\ No newline at end of file
# Projection algorithm produces wrong results
##########################################################################################################
-set int_check 3
-set fract_check 1415927
-
restore [locate_data_file bug23464_c57.draw] c57
restore [locate_data_file bug23464_s46.draw] s46
project result c57 s46
-set info [length result]
-regexp {is +([-0-9.+eE]+)} $info full num
-
-set int_part [expr round($num)]
-set y [expr $num - round($num)]
-set z [expr $y*10000000]
-set fract_part [expr round($z)]
-
-if { ${int_check} != ${int_part} } {
- puts "Error : Integer part of result is incorrect"
-}
-
-if { ${fract_check} != ${fract_part} } {
- puts "Error : Fractional part of result is incorrect"
-}
-
-
-
-
-
+checklength result -l 3.1415926535897998
\ No newline at end of file
# Projection algorithm produces wrong results
##########################################################################################################
-set int_check 3
-set fract_check 1415927
-
restore [locate_data_file bug23464_c58.draw] c58
restore [locate_data_file bug23464_s46.draw] s46
project result c58 s46
-set info [length result]
-regexp {is +([-0-9.+eE]+)} $info full num
-
-set int_part [expr round($num)]
-set y [expr $num - round($num)]
-set z [expr $y*10000000]
-set fract_part [expr round($z)]
-
-if { ${int_check} != ${int_part} } {
- puts "Error : Integer part of result is incorrect"
-}
-
-if { ${fract_check} != ${fract_part} } {
- puts "Error : Fractional part of result is incorrect"
-}
-
-
-
-
-
+checklength result -l 3.1415926535898016
\ No newline at end of file
# Invalid conversion 2D periodic BSpline curve to Bezier segments
#######################################################################################
-set BugNumber OCC7372
-
OCC7372
-set mistake 0
set len [llength [directory segment*]]
if { ${len} != 5 } {
- puts "Faulty ${BugNumber} : segment number is wrong"
- set mistake 1
+ puts "Error: segment number is wrong"
} else {
- set good_length 73.3203
- regexp {The length .* is ([-0-9.+eE]+)} [length segment_5] full current_length
- if { [expr 1.*abs($good_length - $current_length)/$good_length * 100] > 0.1 } {
- puts "Faulty ${BugNumber} : length is wrong for segment_5"
- set mistake 1
- }
+ checklength segment_5 -l 73.3203
renamevar segment_5 result
}
-if { ${mistake} != 0 } {
- puts "Faulty ${BugNumber}"
-} else {
- puts "OK ${BugNumber}"
-}
-
-set 2dviewer 0
-
+set 2dviewer 0
\ No newline at end of file
pcurve a_2
project prj c s
-
-set prj_length [lindex [length prj] end]
-
-set good_length 7.2662499016218058
-checkreal "prj_length" ${prj_length} ${good_length} 0.01 0.01
+checklength prj -l 7.2662499016218058
#v2d2
view 1 -2D- 728 20 400 400
pcurve a_2
project prj c s
-
-set prj_length [lindex [length prj] end]
-
-set good_length 7.2662499016218058
-checkreal "prj_length" ${prj_length} ${good_length} 0.01 0.01
+checklength prj -l 7.2662499016218058
#v2d2
view 1 -2D- 728 20 400 400
restore [locate_data_file bug25084_s10.draw] s
project cx c s
-
-regexp {The length cx is +([0-9.+eE]+)} [length cx] full cx_length
-
-set good_length 4.6201952691345385
-checkreal "length of cp1" ${cx_length} ${good_length} 0.01 0.01
+checklength cx -l 4.6201952691345385
#v2d2
view 1 -2D- 728 20 400 400
project cp1 ct1 s1
project cp2 ct2 s1
-
-regexp {The length cp1 is +([0-9.+eE]+)} [length cp1] full length1
-regexp {The length cp2 is +([0-9.+eE]+)} [length cp2] full length2
-
-set good_length 7.2783309522
-checkreal "length of cp1" ${length1} ${good_length} 0.01 0.01
-checkreal "length of cp2" ${length2} ${good_length} 0.01 0.01
+checklength cp1 -l 7.2783309522
+checklength cp2 -l 7.2783309522
#v2d2
view 1 -2D- 728 20 400 400
mkcurve c e
extrema c s
-regexp {The length ext_1 is +([-0-9.+eE]+)} [length ext_1] full ext_1_length
-set good_length 1.0e-7
-set tol_abs 1.0e-6
-set tol_rel 1.0e-6
-checkreal "length of ext_1" ${ext_1_length} ${good_length} ${tol_abs} ${tol_rel}
+checklength ext_1 -l 8.8817841970012523e-016
trim ct c 3.0050016686511065 3.2781836385284797
extrema ct s
-regexp {The length ext_1 is +([-0-9.+eE]+)} [length ext_1] full ext_1_length
-set good_length 1.0e-7
-set tol_abs 1.0e-6
-set tol_rel 1.0e-6
-checkreal "length of ext_1" ${ext_1_length} ${good_length} ${tol_abs} ${tol_rel}
+checklength ext_1 -l 8.8817841970012523e-016
xdistcs c s 3.140212946671221 3.142972360508366 10 1e-6
mkcurve c e
extrema c s
-regexp {The length ext_1 is +([-0-9.+eE]+)} [length ext_1] full ext_1_length
-set good_length 1.0e-7
-set tol_abs 1.0e-6
-set tol_rel 1.0e-6
-checkreal "length of ext_1" ${ext_1_length} ${good_length} ${tol_abs} ${tol_rel}
+checklength ext_1 -l 4.4408920985006262e-016
xdistcs c s 1.57079 1.5708 10 1e-6
set z 0
proj c $x $y $z
-
-regexp {The length ext_12 is +([0-9.+eE]+)} [length ext_12] full l_12
+checklength ext_12 -l 29.450809988644483
# 2
set tol_abs 1.0e-07
set tol_rel 0.01
-
-set expected_l_12 29.450809988644483
set expected_distmin 3.1958945321254297e-12
-
-checkreal "Length l_12" ${l_12} ${expected_l_12} ${tol_abs} ${tol_rel}
checkreal "Minimal distance" ${distmin} ${expected_distmin} ${tol_abs} ${tol_rel}
set absTol 1.0e-6
set relTol 0.001
-set expectedLength 1.0e-6
set exp_x 12.700000
set exp_y 16.8949999999593
set exp_z 0.534684851975074
puts "Error: No extrema found in case 1"
}
# length check
-set case1Info [length ext_1]
-regexp {The length ext_1 is ([-0-9.+eE]+)} $case1Info full case1Length
-checkreal "case 1 extrema value" $case1Length $expectedLength $absTol $relTol
-
+checklength ext_1 -l 1.0e-6
# case 2: Curve
# existence check
puts "Error: No extrema found in case 2"
}
# length check
-set case2Info [length ext_1]
-regexp {The length ext_1 is ([-0-9.+eE]+)} $case2Info full case2Length
-checkreal "case 2 extrema value" $case2Length $expectedLength $absTol $relTol
+checklength ext_1 -l 1.0e-6
#case 3: Point
# existence check
mksurface s1 a
proj s1 1500 1500 500 g
-set x [lindex [length ext_2] end]
-
+renamevar ext_2 res
proj s1 1500 1500 500 t
-set y [lindex [length ext_1] end]
-
-# Resume
-puts ""
-if { $x == $y } {
- puts "OK ${BugNumber}"
-} else {
- puts "Faulty ${BugNumber}"
-}
+checklength res -l -equal ext_1
if { [info exists test_image ] == 0 } {
set test_image photo
-}
-
-proc checklength {theShape theLength} {
- set aLengthDump [uplevel lprops $theShape -full]
- regexp {Mass\s*:\s*([-0-9.+eE]+)} $aLengthDump dummy aLength
- if {abs($aLength - $theLength) > $theLength * 1e-14} {
- puts "Error: result length is too different."
- }
-}
+}
\ No newline at end of file
fixshape r s -maxtaila 10 -maxtailw 0.7
checknbshapes r -vertex 3 -edge 3 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 9.054743851305652
+checkprops r -l 9.054743851305652
fixshape r s -maxtaila 10 -maxtailw 1
checknbshapes r -vertex 2 -edge 2 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 6.1622776601683791
+checkprops r -l 6.1622776601683791
fixshape r s -maxtaila 10 -maxtailw 1
checknbshapes r -vertex 2 -edge 2 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 6.1622776601683791
+checkprops r -l 6.1622776601683791
fixshape r s -maxtaila 10 -maxtailw 1
checknbshapes r -vertex 2 -edge 2 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 6.1622776601683791
+checkprops r -l 6.1622776601683791
fixshape r s -maxtaila 10 -maxtailw 1.5
checknbshapes r -vertex 1 -edge 1 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 1.4142135623730949
+checkprops r -l 1.4142135623730949
fixshape r s -maxtaila 10 -maxtailw 1.5
checknbshapes r -vertex 1 -edge 1 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 1.4142135623730949
+checkprops r -l 1.4142135623730949
fixshape r s -maxtaila 10 -maxtailw 1.5
checknbshapes r -vertex 1 -edge 1 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 1.4142135623730949
+checkprops r -l 1.4142135623730949
fixshape r s -maxtaila 10 -maxtailw 1.5
checknbshapes r -vertex 1 -edge 1 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 1.4142135623730949
+checkprops r -l 1.4142135623730949
fixshape r s -maxtaila 10 -maxtailw 1.5
checknbshapes r -vertex 1 -edge 1 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 1.4142135623730949
+checkprops r -l 1.4142135623730949
fixshape r s -maxtaila 10 -maxtailw 1.5
checknbshapes r -vertex 1 -edge 1 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 1.4142135623730949
+checkprops r -l 1.4142135623730949
fixshape r s -maxtaila 10 -maxtailw 0.7
checknbshapes r -vertex 5 -edge 7 -wire 4 -face 4 -shell 1 -solid 0 -compsolid 0 -compound 0
-checklength r 69.237606465667483
+checkprops r -l 69.237606465667483
fixshape r s -maxtaila 10 -maxtailw 0.7
checknbshapes r -vertex 3 -edge 3 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 9.054743851305652
+checkprops r -l 9.054743851305652
fixshape r s -maxtaila 10 -maxtailw 0.7
checknbshapes r -vertex 3 -edge 3 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 9.054743851305652
+checkprops r -l 9.054743851305652
fixshape r s -maxtaila 10 -maxtailw 0.7
checknbshapes r -vertex 3 -edge 3 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 9.0547440573886373
+checkprops r -l 9.0547440573886373
fixshape r s -maxtaila 10 -maxtailw 0.7
checknbshapes r -vertex 3 -edge 3 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 9.0547440573886373
+checkprops r -l 9.0547440573886373
fixshape r s -maxtaila 10 -maxtailw 0.7
checknbshapes r -vertex 3 -edge 3 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 9.0547440573886373
+checkprops r -l 9.0547440573886373
fixshape r s -maxtaila 10 -maxtailw 1
checknbshapes r -vertex 2 -edge 2 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 6.1622776601683791
+checkprops r -l 6.1622776601683791
fixshape r s -maxtaila 10 -maxtailw 1
checknbshapes r -vertex 2 -edge 2 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 6.1622776601683791
+checkprops r -l 6.1622776601683791
fixshape r s -maxtaila 10 -maxtailw 1
checknbshapes r -vertex 2 -edge 2 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 6.1622776601683791
+checkprops r -l 6.1622776601683791
fixshape r s -maxtaila 1 -maxtailw 6e-3
checknbshapes r -vertex 16 -edge 16 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 17.514170299083325
+checkprops r -l 17.514170299083325
fixshape r s -maxtaila 1 -maxtailw 3e-3
checknbshapes r -vertex 5 -edge 5 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 1.9646975436380054
+checkprops r -l 1.9646975436380054
fixshape r s -maxtaila 1 -maxtailw 1e-4
checknbshapes r -vertex 7 -edge 7 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 5.4302952062350922
+checkprops r -l 5.4302952062350922
fixshape r s -maxtaila 1 -maxtailw 1e-2
checknbshapes r -vertex 3 -edge 3 -wire 1 -face 1 -shell 0 -solid 0 -compsolid 0 -compound 0
-checklength r 21.767418596938622
+checkprops r -l 21.767418596938622
fixshape r s -maxtaila 1 -maxtailw 1e-3
checknbshapes r -vertex 25951 -edge 42000 -wire 16519 -face 16205 -shell 51 -solid 1 -compsolid 0 -compound 2
-checklength r 127197.46264592493
+checkprops r -l 127197.46264592493
fixshape r s 1e-3 1 -maxtaila 6 -maxtailw 1e-3
checknbshapes r -vertex 257 -edge 395 -wire 146 -face 137 -shell 1 -solid 1 -compsolid 0 -compound 0
-checklength r 4611.0742231217555
+checkprops r -l 4611.0742231217555
fixshape r s 1e-3 1 -maxtaila 6 -maxtailw 1e-3
checknbshapes r -vertex 8494 -edge 13832 -wire 5955 -face 5466 -shell 1 -solid 1 -compsolid 0 -compound 0
-checklength r 69141.057126027736
+checkprops r -l 69141.057126027736