-
-
Notifications
You must be signed in to change notification settings - Fork 402
Description
import os
from OCC.Extend.DataExchange import write_gltf_file, read_step_file, read_gltf_file, write_step_file
def step_to_glb(import_file_path, export_file_path):
shape = read_step_file(import_file_path)
write_gltf_file(shape, export_file_path)
return export_file_path
def glb_to_step(import_file_path, export_file_path):
shape = read_gltf_file(import_file_path)
write_step_file(shape[0], export_file_path)
return export_file_path
tmp_path = './test_files'
step_file = './test_files/BGA121C50P11X11_600X600X100B30N.STEP'
for i in range(1, 5):
export_glb_path = os.path.join(tmp_path, f'test_{i}.gltf')
export_step_path = os.path.join(tmp_path, f'test_{i}.step')
step_to_glb( step_file,export_glb_path)
glb_to_step(export_glb_path,export_step_path)
step_file = export_step_path
print(f"{i} done")
When I used these APIs to convert file formats, I encountered an error.
miniconda3/envs/cad_env/lib/python3.12/site-packages/OCC/Extend/DataExchange.py", line 118, in read_step_file
raise AssertionError("Transfer failed.")
AssertionError: Transfer failed.