mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0027561: Since OCCT 7.0.0, exporting a curve to STL creates a file that results in an endless loop when read
Add check for empty triangulation when writing STL file to report error instead of creation of empty file. STL reader has been improved to properly handle case of empty or small files, and Ascii files without EOL at the end.
This commit is contained in:
@@ -49,8 +49,11 @@ Standard_Boolean StlAPI_Writer::Write (const TopoDS_Shape& theShape,
|
||||
{
|
||||
TopLoc_Location aLoc;
|
||||
Handle(Poly_Triangulation) aTriangulation = BRep_Tool::Triangulation (TopoDS::Face (anExpSF.Current()), aLoc);
|
||||
aNbNodes += aTriangulation->NbNodes();
|
||||
aNbTriangles += aTriangulation->NbTriangles();
|
||||
if (! aTriangulation.IsNull())
|
||||
{
|
||||
aNbNodes += aTriangulation->NbNodes ();
|
||||
aNbTriangles += aTriangulation->NbTriangles ();
|
||||
}
|
||||
}
|
||||
|
||||
// create temporary triangulation
|
||||
|
Reference in New Issue
Block a user