Error while Conversting from IGES to STL in VS2013 & OCC 6.9.1

Hi Everyone,

                   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 guys. I havent faced with this issue earlier.

Sunayana Ghosh's picture

Hello all,

I have exactly the same problem in writing a topods_shape object to an stl file

StlAPI_Reader stl_reader;
TopoDS_Shape aShape;
 stl_reader.Read(aShape, "bottle.stl");

Standard_Boolean status = aShape.IsNull(); //<----status here is 0, i.e., not null

StlAPI_Writer stl_writer;
StlAPI_ErrorStatus errStat = stl_writer.Write(aShape, "bottle-occ.stl");  //<-----errStat here is 1, i.e., StlAPI_MeshIsEmpty

Any help would be appreciated.