Open GehadMlanh opened 4 years ago
Update to the latest pythonocc release, and try the following code:
input_file = 'm12_2.stp' # input STEP (AP203/AP214 file)
output_file = 'm12_2.x3d' # output X3D file
from OCC.Extend.DataExchange import read_step_file
from OCC.Core.Tesselator import ShapeTesselator
aResShape = read_step_file(input_file)
tess = ShapeTesselator(aResShape)
tess.Compute()
tess.ExportShapeToX3D( output_file )
Thank you for your answer ... It works . But I have a 3d design which consists of multiple parts. Is there a way to not show it as one solid part but as a multiple parts including colors.
info to my application , actually I am trying to use x3d in the websites so that the users can select and unselect some parts. so if you think there is another way to do it using occ iI will appreciate your help
Thank you
See the demo https://github.com/tpaviot/pythonocc-demos/blob/master/examples/core_webgl_x3dom_bigfile_multipleshapes.py as well as the read_step_file_with_names_colors
function at https://github.com/tpaviot/pythonocc-core/blob/master/src/Extend/DataExchange.py#L127
I am trying to convert my stp file to x3d file . I am using the following code
it shows me an error in the : from OCC.Visualization import Tesselator, atNormal ... it is not there .. I have found it in from OCC.Tesselator import T_esselator.
but it still not working
Any advice is highly appreaciated ....