Files
OCCT/tests/bugs/step/bug_ocp1949_2
ikochetkova f1cb756901 Data Exchange, Step Export - Ignoring unit factors during tessellation export (#577)
Provide unit factors into the tessellation export methods.
2025-06-20 15:38:33 +01:00

49 lines
1.0 KiB
Plaintext

puts "================================================"
puts "OCP-1949: Apply a scaling transformation to STEP"
puts "================================================"
puts ""
pload OCAF
Close D1 -silent
Close D2 -silent
# Create simple mesh
box b 1 1 1
incmesh b 1
writestl b "$imagedir/${casename}.stl"
readstl b "$imagedir/${casename}.stl"
# Create document with meters as internal units
XNewDoc D1
XSetLengthUnit D1 m
XAddShape D1 b
# apply parameters for tessellation export
set conf "
provider.STEP.OCC.write.schema : 5
provider.STEP.OCC.write.tessellated : 1
"
WriteFile D1 "$imagedir/${casename}.stp" -conf ${conf}
ReadFile D2 "$imagedir/${casename}.stp"
XGetOneShape a1 D1
XGetOneShape a2 D2
# check sizes
set m_diag [eval distpp [bounding a1]]
set mm_diag [eval distpp [bounding a2]]
set tol 0.1
if {([expr abs($m_diag * 1000 - $mm_diag)] > $tol)} {
puts "Error: wrong size of models."
}
# cleaning
Close D1
Close D2
file delete "$imagedir/${casename}.stp"
file delete "$imagedir/${casename}.stl"