1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00
occt/tests/bugs/step/bug33095
2025-03-03 12:11:30 +00:00

39 lines
1.2 KiB
Plaintext

puts "======="
puts "0033095: Data Exchange, Step Import - Wrong PMI values when loading a *.stp file in m"
puts "======="
pload OCAF
catch { Close D_mm }
catch { Close D_m }
# Read file in mm
ReadStep D_mm [locate_data_file bug33095_cad_with_pmi.stp]
set plusMinusTol_mm [XGetDimensionPlusMinusTol D_mm 0:1:4:77]
set dim_value_mm [XGetDimensionValue D_mm 0:1:4:77]
# Read file in m
XNewDoc D_m
XSetLengthUnit D_m m
ReadStep D_m [locate_data_file bug33095_cad_with_pmi.stp]
set plusMinusTol_m [XGetDimensionPlusMinusTol D_m 0:1:4:77]
set dim_value_m [XGetDimensionValue D_m 0:1:4:77]
# Checking
regexp {lower +([-0-9.+eE]+) +upper +([-0-9.+eE]+)} $plusMinusTol_m full lower_m upper_m
regexp {lower +([-0-9.+eE]+) +upper +([-0-9.+eE]+)} $plusMinusTol_mm full lower_mm upper_mm
set lower_m_to_mm [expr {$lower_m * 1000}]
set upper_m_to_mm [expr {$upper_m * 1000}]
set value_m_to_mm [expr {$dim_value_m * 1000}]
if {[expr {abs($lower_m_to_mm - $lower_mm)}] > 1e-2} {
puts "Error: incorrect scaling lower toleranse value"
}
if {[expr {abs($upper_m_to_mm - $upper_mm)}] > 1e-2} {
puts "Error: incorrect scaling upper toleranse value"
}
if {[expr {abs($value_m_to_mm - $dim_value_mm)}] > 1e-2} {
puts "Error: incorrect scaling main dimension value"
}