I am trying to make simple converter from GTLF (GLB) to STEP format. I am using a simple box as my test input (see attached .zip).
Reading of the GTLF file seems to work fine using:
# Create an handle to a document
doc = TDocStd_Document("gltf-convert-doc")
# Create GLTF reader
gltf_reader = RWGltf_CafReader()
gltf_reader.SetDocument(doc)
read_status = gltf_reader.Perform(input_filename, Message_ProgressRange())
if read_status != IFSelect_RetDone:
raise AssertionError("Could not load GLTF file")
# Get as single shape
shape = gltf_reader.SingleShape()
I get a single compound top level shape with 6 faces.
For converting and writing to STEP I am doing the following:
# Create STEP writer
step_writer = STEPControl_Writer()
Interface_Static.SetCVal("write.step.schema", "ap203")
# transfer shapes and write file
step_writer.Transfer(shape, STEPControl_AsIs)
write_status = step_writer.Write(output_filename)
if write_status != IFSelect_RetDone:
raise AssertionError("Could not write STEP file.")
Which seems to be working. It produces a .stp file with content. But when I open the file with a CAD program (such a CAD Assistant) it shows nothing (see attached screenshot).
Any insight would be much appreciated.
Discussion
3 archived replies
Posts are displayed in their archived order.
01Commenter-1
Hello, you trying to export mesh format into BRep format. In that case there are a few limitations.
1. CAD Assistent based on old OCCT and do not support STP with mesh
2. STP format support mesh only on AP214 and AP242. But I really recommend to use ONLY AP242
3. OCCT older then 7.7 do not support import or export STP files with mesh.
Best regards, Commenter-1
02Author
Thank you for the response.
I and using OCCT 7.8.1 and I have tried switching to AP242 with: