MantisBT
Mantis Bug Tracker Workflow

View Revisions: Issue #31504 All Revisions ] Back to Issue ]
Summary 0031504: Data Exchange - Wrong output of progress indicator when writing to stl.
Revision 2020-05-08 00:11 by kgv
Steps To Reproduce Execute the command "rewrite_stl C:/dev_cad_party/wright_whirlwind_radial_engine_occ.stl C:/dev_cad_party/NEW_wright_whirlwind_radial_engine_occ.stl" on wright_whirlwind_radial_engine_occ.stl

Bug: the progress indicator showed that it performed 3% (1000/36512) when writing, but in fact the model was completely recorded. We also see that 1000 triangles are loaded, although there should be 2000.

#include <Draw_ProgressIndicator.hxx>
#include <RWStl.hxx>

static Standard_Integer DRAW_ReWriteSTL(Draw_Interpretor& theDI, Standard_Integer theArgc, const 
char** theArgv)
{
  TCollection_AsciiString aFilePathToRead  = theArgv[1];
  TCollection_AsciiString aFilePathToWrite = theArgv[2];
  if ( aFilePathToRead.IsEmpty() || aFilePathToWrite.IsEmpty() )
    return 1;
  //
  // Read STL file to the triangulation.
  Handle(Poly_Triangulation) aTriangulation = RWStl::ReadFile (aFilePathToRead.ToCString(), NULL);
  //
  //
  // Indicator.
  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator (theDI, 1);
  aProgress->SetTextMode(true);
  //
  // Write to STL.
  OSD_Path aPath (aFilePathToWrite.ToCString());
  if ( !RWStl::WriteAscii (aTriangulation, aPath, aProgress) )
    return 1; // Success
  //
  return 0;
}

theCommands.Add("rewrite_stl",
                "rewrite_stl filenameToRead filenameToWrite",
                __FILE__, DRAW_ReWriteSTL, grp);
Revision 2020-04-17 10:37 by avn
Steps To Reproduce Execute the command "rewrite_stl C:/dev_cad_party/wright_whirlwind_radial_engine_occ.stl C:/dev_cad_party/NEW_wright_whirlwind_radial_engine_occ.stl" on wright_whirlwind_radial_engine_occ.stl

Bug: the progress indicator showed that it performed 3% (1000/36512) when writing, but in fact the model was completely recorded. We also see that 1000 triangles are loaded, although there should be 2000.

#include <Draw_ProgressIndicator.hxx>
#include <RWStl.hxx>

static Standard_Integer DRAW_ReWriteSTL(Draw_Interpretor& theDI, Standard_Integer theArgc, const char** theArgv)
{
  TCollection_AsciiString aFilePathToRead = theArgv[1];
  TCollection_AsciiString aFilePathToWrite = theArgv[2];
  if ( aFilePathToRead.IsEmpty() || aFilePathToWrite.IsEmpty() )
    return 1;
  //
  // Read STL file to the triangulation.
  Handle(Poly_Triangulation) aTriangulation = RWStl::ReadFile (aFilePathToRead.ToCString(), NULL);
  //
  //
  // Indicator.
  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator (theDI, 1);
  aProgress->SetTextMode(true);
  //
  // Write to STL.
  OSD_Path aPath (aFilePathToWrite.ToCString());
  if ( !RWStl::WriteAscii (aTriangulation, aPath, aProgress) )
    return 1; // Success
  //
  return 0;
}

theCommands.Add("rewrite_stl",
                "rewrite_stl filenameToRead filenameToWrite",
                __FILE__, DRAW_ReWriteSTL, grp);
Revision 2020-04-17 10:30 by avn
Steps To Reproduce Execute the command "rewrite_stl C:/dev_cad_party/wright_whirlwind_radial_engine_occ.stl C:/dev_cad_party/NEW_wright_whirlwind_radial_engine_occ.stl" on wright_whirlwind_radial_engine_occ.stl

Bug: the progress indicator showed that it performed 0% of the record, but in fact the model was completely recorded. We also see that 1000 triangles are loaded, although there should be 2000.

#include <Draw_ProgressIndicator.hxx>
#include <RWStl.hxx>

static Standard_Integer DRAW_ReWriteSTL(Draw_Interpretor& theDI, Standard_Integer theArgc, const char** theArgv)
{
  TCollection_AsciiString aFilePathToRead = theArgv[1];
  TCollection_AsciiString aFilePathToWrite = theArgv[2];
  if ( aFilePathToRead.IsEmpty() || aFilePathToWrite.IsEmpty() )
    return 1;
  //
  // Read STL file to the triangulation.
  Handle(Poly_Triangulation) aTriangulation = RWStl::ReadFile (aFilePathToRead.ToCString(), NULL);
  //
  //
  // Indicator.
  Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator (theDI, 1);
  aProgress->SetTextMode(true);
  //
  // Write to STL.
  OSD_Path aPath (aFilePathToWrite.ToCString());
  if ( !RWStl::WriteAscii (aTriangulation, aPath, aProgress) )
    return 1; // Success
  //
  return 0;
}

theCommands.Add("rewrite_stl",
                "rewrite_stl filenameToRead filenameToWrite",
                __FILE__, DRAW_ReWriteSTL, grp);


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker