Files
OCCT/tests/heal/drop_small_solids/end
myn 8422b578d7 0025529: ShapeProcessAPI: introduce DropSmallSolids operator
Implemented DropSmallSolids operator

Source code corrected and optimized; tests added

tests improved
2014-12-11 17:35:41 +03:00

32 lines
1018 B
Plaintext

proc parseprops a {
return [regexp -inline {Center of gravity :[
]+X = +([-0-9.+eE]+)[
]+Y = +([-0-9.+eE]+)[
]+Z = +([-0-9.+eE]+)[
]+Matrix of Inertia :[
]+([-0-9.+eE]+)[\t ]+([-0-9.+eE]+)[\t ]+([-0-9.+eE]+)[
]+([-0-9.+eE]+)[\t ]+([-0-9.+eE]+)[\t ]+([-0-9.+eE]+)[
]+([-0-9.+eE]+)[\t ]+([-0-9.+eE]+)[\t ]+([-0-9.+eE]+)} $a]
}
proc cmpprops {cmd a b} {
set aa [parseprops [$cmd $a]]
set bb [parseprops [$cmd $b]]
for {set i 1} {$i < [llength $aa]} {incr i} {
if {[expr abs([lindex $aa $i] - [lindex $bb $i])] > 1e-8} {return 0}
}
return 1
}
set env(CSF_resDefaults) [file dirname [locate_data_file res]]
restore [locate_data_file test.brep] a
DT_ApplySeq result a res $cmd
restore [locate_data_file $ref.brep] r
puts [checkshape result]
if {[statshape result] != [statshape r]} {puts "Error: STATSHAPE"}
if {![cmpprops vprops result r]} {puts "Error: VPROPS"}
if {![cmpprops sprops result r]} {puts "Error: SPROPS"}
if {![cmpprops lprops result r]} {puts "Error: LPROPS"}