Export to step files with colors, transparency...

Hello,

I'm wondering how I can generate a step file with color and transparency.
I have as input a set of TopoDS_Shape and for each of these shapes colors/transparency I would like to apply,
and I'm expecting as output a step file with the colors stored in it.

Thanks a lot for your help suggestions and ideas...

best regards
Guillaume

Andrey BETENEV's picture

Hello,

The standard way to define models annotated with names, colors, transparency etc. in OCCT is though the use of the XDE component.

You can find examples of the DRAW script that constructs a colored model in XDE document among the DRAW samples. For that, start DRAW, then open menu Samples -> View Samples -> XDE. The sample named "Intel i7-4790 CPU" contains also a command to write the result to the STEP file (see the end of the script).

On the C++ level, the class STEPCAFControl_Writer is the tool that converts an XDE document to a STEP file.

Andrey

Guillaume Stamm's picture

Hello Andrey,

Thanks a lot for your quick reply. It gave me the "entry/starting point"
I'm using PythonOCC and managed to use
OCC.XCAFDoc.XCAFDoc_DocumentTool_ColorTool
OCC.STEPCAFControl.STEPCAFControl_Writer
and I get colored shapes. :-)

But for now I did not found where I can set the transparency,
and curiously on a "big" shape (assembly including many others) the color instruction was not taken into account.

Guillaume

Andrey BETENEV's picture

Hello Guillaume,

Sorry but in fact transparency and other presentation parameters of the objects are not supported yet in STEP import / export.
Relevant issues #23037, #29902 are still pending, so your help in developing this new functionality will be appreciated.

Andrey