| 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" | |