1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-06-30 12:14:08 +03:00
occt/tests/bugs/step/bug_ocp1949
ikochetkova 18a46604fc
Data Exchange, Step Export - Apply a scaling transformation (#513)
Add possibility to export scaling factor into the STEP file as a cartesian_transformation_operator_3d.
Add flag for turning on/off (on by default) this behavior.
2025-05-12 17:15:58 +01:00

52 lines
1.2 KiB
Plaintext

puts "================================================"
puts "OCP-1949: Apply a scaling transformation to STEP"
puts "================================================"
puts ""
pload OCAF
Close D1 -silent
Close D2 -silent
ReadGltf D1 [locate_data_file bug_ocp1948_PSU_Cartoning_subunit__right-01.01.01.03-CART-03_green_bottom.glb]
# apply parameters for tessellation export
set conf "
provider.STEP.OCC.write.schema : 5
provider.STEP.OCC.write.tessellated : 1
"
LoadConfiguration ${conf} -recursive on
param write.step.schema 5
param write.step.tessellated 1
WriteStep D1 "$imagedir/${casename}.stp"
ReadStep D2 "$imagedir/${casename}.stp"
XGetOneShape a1 D1
XGetOneShape a2 D2
# check center of gravity
set pos1 [vprops a1]
set pos2 [vprops a2]
set REF_X [lindex $pos1 9]
set REF_Y [lindex $pos1 12]
set REF_Z [lindex $pos1 15]
set tol 1e-4
if {([expr abs($REF_X - [lindex $pos2 9])] > $tol) ||
([expr abs($REF_Y - [lindex $pos2 12])] > $tol) ||
([expr abs($REF_Z - [lindex $pos2 15])] > $tol)} {
puts "Error: wrong position of the imported model."
}
# cleaning
Close D1
Close D2
file delete "$imagedir/${casename}.stp"
set conf "
provider.STEP.OCC.write.schema : 4
provider.STEP.OCC.write.tessellated : 2
"
LoadConfiguration ${conf} -recursive on