Export to step files with colors, transparency...

gstamm's picture

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

abv's picture

Use XDE

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

gstamm's picture

Thanks, XDE working with PythonOCC

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

abv's picture

Alas, transparency in STEP is not supported yet

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

www.opencascade.com

Copyright 2011-2019
OPEN CASCADE SAS
Contact us