ByteArray Stream of STL file into TopoDS_Shape

Dear OCCT Community,

I have a bytearray of an STL file and I would like to set into TopoDS_Shape (or any data structure of OCCT for visualizing as AIS_Interactive Context). 

As a workaround, we read this bytearray using the RwStl class after saving it to the stl file. However, this causes performance loss. Is there an easy and direct way to do this?

Thank you in advance!

Best regards

Dmitrii Pasukhin's picture


Please take a look into RWStl_Reader::ReadBinary(...) or RWStl_Reader::ReadAscii(...)

This class and methods be able to read from std::istream

Best regards, Dmitrii.