#!/usr/bin/env python # coding: utf-8 # In[6]: import os from OCC.Core.gp import gp_Dir from OCC.Display.WebGl.jupyter_renderer import JupyterRenderer from OCC.Extend.DataExchange import read_step_file, export_shape_to_svg from OCC.Display.WebGl.x3dom_renderer import X3DExporter # In[2]: robot_shp = read_step_file(os.path.join('..', 'assets', 'models', 'KR600_R2830-4.stp')) # In[7]: x3dexp = X3DExporter(robot_shp, None, None, False, (1,0,0), (0,0,0), 0, 0, (0,0,0), 2, 1) # In[13]: x3dexp.compute() # In[14]: len(x3dexp._triangle_sets) # In[11]: x3d=x3dexp.to_x3dfile_string(0) # In[12]: x3d # In[ ]: # In[ ]: