mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0027273: The computation of linear properties on shared shapes is not correct
New flag is inserted in parameters of static methods LinearProperties(...), surfaceProperties(...), volumeProperties(...). This flag defines to skip or not to skip second and next appearance shared topology entities (edges, faces, shells) in properties calculation. Corresponding Draw commands is modified to take in account new parameter. Test case for issue CR27273 Add option -skip into checkprops command
This commit is contained in:
@@ -503,6 +503,7 @@ help checkprops {
|
||||
-eps EPSILON: the epsilon defines relative precision of computation
|
||||
-equal SHAPE: compare area\volume\length of input shapes. Puts error if its are not equal
|
||||
-notequal SHAPE: compare area\volume\length of input shapes. Puts error if its are equal
|
||||
-skip: count shared shapes only once, skipping repeatitions
|
||||
Options -l, -s and -v are independent and can be used in any order. Tolerance epsilon is the same for all options.
|
||||
}
|
||||
|
||||
@@ -522,10 +523,12 @@ proc checkprops {shape args} {
|
||||
set compared_equal_shape -1
|
||||
set compared_notequal_shape -1
|
||||
set equal_check 0
|
||||
set skip 0
|
||||
|
||||
set options {{"-eps" epsilon 1}
|
||||
{"-equal" compared_equal_shape 1}
|
||||
{"-notequal" compared_notequal_shape 1}}
|
||||
{"-notequal" compared_notequal_shape 1}
|
||||
{"-skip" skip 0}}
|
||||
|
||||
if { [regexp {\-[not]*equal} $args] } {
|
||||
lappend options {"-s" area 0}
|
||||
@@ -557,12 +560,18 @@ proc checkprops {shape args} {
|
||||
set prop "volume"
|
||||
set equal_check 0
|
||||
}
|
||||
|
||||
set skip_option ""
|
||||
if { $skip } {
|
||||
set skip_option "-skip"
|
||||
}
|
||||
|
||||
|
||||
regexp {Mass +: +([-0-9.+eE]+)} [${CommandName} ${shape} ${epsilon}] full m
|
||||
regexp {Mass +: +([-0-9.+eE]+)} [eval ${CommandName} ${shape} ${epsilon} $skip_option] full m
|
||||
|
||||
if { ${compared_equal_shape} != -1 } {
|
||||
upvar ${compared_equal_shape} ${compared_equal_shape}
|
||||
regexp {Mass +: +([-0-9.+eE]+)} [${CommandName} ${compared_equal_shape} ${epsilon}] full compared_m
|
||||
regexp {Mass +: +([-0-9.+eE]+)} [eval ${CommandName} ${compared_equal_shape} ${epsilon} $skip_option] full compared_m
|
||||
if { $compared_m != $m } {
|
||||
puts "Error: Shape ${compared_equal_shape} is not equal to shape ${shape}"
|
||||
}
|
||||
@@ -570,7 +579,7 @@ proc checkprops {shape args} {
|
||||
|
||||
if { ${compared_notequal_shape} != -1 } {
|
||||
upvar ${compared_notequal_shape} ${compared_notequal_shape}
|
||||
regexp {Mass +: +([-0-9.+eE]+)} [${CommandName} ${compared_notequal_shape} ${epsilon}] full compared_m
|
||||
regexp {Mass +: +([-0-9.+eE]+)} [eval ${CommandName} ${compared_notequal_shape} ${epsilon} $skip_option] full compared_m
|
||||
if { $compared_m == $m } {
|
||||
puts "Error: Shape ${compared_notequal_shape} is equal shape to ${shape}"
|
||||
}
|
||||
|
Reference in New Issue
Block a user