How to get Poly_triangulation from STEP file?

Hi,

I want to convert a STEP file into an STL file and then do some analysis using the data of vertices and faces of the STL mesh thus obtained. Poly_triangulation provides that data but the only way I could find to obtain Poly_Triangulation data is by using RWStl::ReadFile(). In this case, I have to first run BRep_IncrementalMesh() on the TopoDS_Shape of the STEP file, save it as an STL file, then read it back using RWSTL::ReadFile(). This process becomes too long with a redundant step of writing the STL file first. Is there a way, I could directly extract the Poly_Triangulation information from the STEP file or the converted "mesh" file after the step of calling BRepMesh_IncrementalMesh?

Thanks!

he huang's picture

Why not use the source code of

Standard_Boolean StlAPI_Writer::Write (const TopoDS_Shape& theShape,
const Standard_CString theFileName,
const Message_ProgressRange& theProgress).

It shows the detail steps of triangulation.