Stl exporter requires interactive context ?

Hello Everyone,
I have really interesting question for my side.

When I use StlAPI_Writer to export shape to STL format, it works only if I call for shape the function:
myAISContext->Display( aisShape, Standard_True );

Without displaying shape under interactive context, fails for shape.

What could be wrong? I need Export shapes to STL in silent mode withoud showing it on screen.

Thank you, in advance.

Andrey BETENEV's picture


STL converter requires the shape to be tessellated, as it exports triangulation. Tessellation is performed automatically when you display the shape in 3D viewer, that is why it works after display. Instead, use class BRepMesh_IncrementalMesh to generate tessellation before export.


Eugene Zaliznyak's picture

Thank you Andrey, that works.
With respects, Eugene.