Sun, 06/19/2016 - 00:34
How to fix problem with StlAPI_Writer in OCC 7.0.0 ?
Version 6.8.0 worked perfect for code
void shape_write_stl ( const TopoDS_Shape& s, Standard_CString filepath )
{
StlAPI_Writer writer;
StlAPI_ErrorStatus Error = writer.Write( s, filepath );
......
}
But version 7.0.0 saving text in stl file "STL binary file, created with Open CASCADE Technology" or "solid shape, STL ascii file, created with Open CASCADE Technology endsolid shape" AND THAT'S ALL! No any problems with TopoDS_Shape cause worked for same shapes in 6.8.0... Also writer.Write returns result StlAPI_StatusOK
HOW TO FIX THIS BUG ?
Mon, 06/20/2016 - 13:04
Since version 6.9.0, STL writer relies on triangulation stored in the shape for exporting STL data (see Release Notes of OCCT 6.9.0, issue 25357).
This allows better control over the quality of the triangulation (in previous versions shape was triangulated by STL writer internally).
Use BRepMesh_IncrementalMesh to build triangulation before calling StlAPI_Writer.
FSR
Tue, 06/21/2016 - 07:36
Added lines
BRepMesh_IncrementalMesh Mesh( s, 0.01 );
Mesh.Perform();
before writer.Write...
All works. Thank You!!!
Thu, 12/28/2017 - 14:33
As suggested above I had used BRepMesh_IncrementalMesh() before calling StlAPI_Writer.But the code is exiting saying segmentation fault.Further debugging shown me its causing in the line StlAPI_Writer.Write().
Opencascade version used is 7.0.0
Could you suggest a fix.
Fri, 09/27/2019 - 21:33
I'm experiencing same issue, but only for older step file AP203