How to Load STL File


I can i load .STL file in OpenCasCade ? I found STL writer but not STL reader in ImportExport sample.

Pawel's picture

Hi Alex,

search the forum. For example you can have a look at:

Good luck!

devil20's picture

Dear Pawel

Thanx for reply. I'll try to do this.

Anup's picture

Hi Pawel,

                Can you please help me with this. I have written a code to convert from IGES/IGS file to STL file. When i was using OCC-6.6.0 this code was working perfectly, Due to some reasons i had to migrate to Visual studio 2013 so i downloaded OCC 6.9.1, Now i am facing with weird issue which i am not able to resolve. I have attached screenshot while i debug you can have a look at it. The following is my code

    IGESControl_Reader My_reader;

    Standard_Integer status = My_reader.ReadFile(file);

    status = My_reader.TransferRoots();

    /// The shape stores all translated data as single shape
    IGES_Shape = My_reader.OneShape();

    status = IGES_Shape.IsNull(); //  <--- --- ---- over here the status value is 0 i.e., Standard_boolean value is false /// so the shape is not NULL

    StlAPI_Writer wr;
    status = wr.Write(IGES_Shape, "temp/IGES_Temp.stl"); // <- - --- --------- ( over here the status value is 1 i.e., //StlAPI_ErrorStatus = StlAPI_MeshIsEmpty  which is showing me that the mesh is empty.)

Please help me out. I havent faced with this issue earlier.