mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-06-15 12:07:41 +08:00
Implemented DropSmallSolids operator Source code corrected and optimized; tests added tests improved
32 lines
1018 B
Plaintext
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"}
|
|
|