View Issue Details

IDProjectCategoryView StatusLast Update
0027561CommunityOCCT:Data Exchangepublic2017-09-29 16:29
ReporterMarkus Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version7.0.0 
Target Version7.2.0Fixed in Version7.2.0 
Summary0027561: Data Exchange - since OCCT 7.0.0, exporting a curve to STL creates a file that results in an endless loop when read
DescriptionIn 7.0.0, when a curve is exported to STL a file is created that seems to contain only header information. When this file is read, it results in an endless loop.

In 6.9.0, when a curve is exported to STL no file is created! Instead, Draw shows an error message: "** Error **: Mesh is empty. Please, compute triangulation before."

Surely, curves cannot be represented in STL files, but in any case if such files are read it should not result in an endless loop.

The endless loop occurs in RWStl::ReadAscii in the following code:
  
  while (getc(file) != '\n');
Steps To Reproduce
pload XDE
restore curve.brep c
whatis c
writestl c curve.stl
readstl c2 curve.stl
TagsNo tags attached.
Test case numberde_mesh stl_read D1

Attached Files

  • curve.brep (5,371 bytes)

Relationships

related to 0026338 closedbugmaster STL export (especially binary) needs a lot of time if selected export path is not local 

Activities

Timo

2016-06-02 15:57

developer  

curve.brep (5,371 bytes)

git

2017-08-16 15:05

administrator   ~0069459

Branch CR27561 has been created by abv.

SHA-1: b500db320d488ac05601372e3cc7d397ed763f58


Detailed log of new commits:

Author: abv
Date: Tue Aug 15 17:58:53 2017 +0300

    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.
    Test added for that: bugs stlvrml bug27561
    
    STL reader has been improved to properly handle case of empty or small files, and Ascii files without EOL at the end.
    Test added for that: de_mesh stl_read D1

abv

2017-08-17 09:28

manager   ~0069498

Endless loop does not occur any more when reading empty STL files; apparently this has been fixed by changes made within 0028840.

I have pushed correction for writer to fail in case of empty triangulation (instead of writing empty file), and for reader to treat properly case of empty or small STL files. Please review: branch CR27561.

The tests have passed, see Jenkins job CR27561-master-abv.

kgv

2017-08-17 09:39

developer   ~0069499

Please take the patch.

bugmaster

2017-08-17 12:24

administrator   ~0069514

Last edited: 2017-08-17 12:29

Combination -
OCCT branch : CR27561 - SHA-1: b500db320d488ac05601372e3cc7d397ed763f58
Products branch : master
was compiled on Linux, MacOS and Windows platforms and tested on optimize mode.

Number of compiler warnings:

OCCT :
Linux: 0 (0 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

Products :
Linux: 5 (5 on master)
Windows: 0 (0 on master)
MacOS : 0 (0 on master)

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:

Windows:
OCCT
Total CPU difference: 17330.010689098726 / 17295.75286949859 [+0.20%]
Producst
Total CPU difference: 7688.758886599963 / 7720.302288799964 [-0.41%]

Linux:
OCCT
Total CPU difference: 19451.89000000023 / 19456.560000000376 [-0.02%]
Products
Total CPU difference: 7703.40000000009 / 7725.120000000072 [-0.28%]

Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2017-08-18 17:00

administrator   ~0069615

Branch CR27561 has been deleted by kgv.

SHA-1: b500db320d488ac05601372e3cc7d397ed763f58

Related Changesets

occt: master 22e70738

2017-08-15 14:58:53

abv


Committer: bugmaster Details Diff
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.
Affected Issues
0027561
mod - src/RWStl/RWStl.cxx Diff File
mod - src/RWStl/RWStl_Reader.cxx Diff File
mod - src/StlAPI/StlAPI_Writer.cxx Diff File
add - tests/de_mesh/stl_read/D1 Diff File
rm - tests/de_mesh/stl_read/end Diff File

Issue History

Date Modified Username Field Change
2016-06-02 15:57 Timo New Issue
2016-06-02 15:57 Timo Assigned To => gka
2016-06-02 15:57 Timo File Added: curve.brep
2016-06-02 17:05 Timo Relationship added related to 0026338
2016-06-15 15:45 abv Assigned To gka => ika
2016-06-15 15:45 abv Status new => assigned
2016-10-26 18:46 gka Target Version 7.1.0 => 7.2.0
2017-05-31 15:40 Timo Reporter Timo => Markus
2017-08-16 15:05 git Note Added: 0069459
2017-08-16 15:30 kgv Steps to Reproduce Updated
2017-08-16 15:31 kgv Summary Since OCCT 7.0.0, exporting a curve to STL creates a file that results in an endless loop when read => Data Exchange - since OCCT 7.0.0, exporting a curve to STL creates a file that results in an endless loop when read
2017-08-16 15:32 kgv Assigned To ika => abv
2017-08-17 09:28 abv Note Added: 0069498
2017-08-17 09:28 abv Assigned To abv => kgv
2017-08-17 09:28 abv Status assigned => resolved
2017-08-17 09:39 kgv Note Added: 0069499
2017-08-17 09:39 kgv Assigned To kgv => bugmaster
2017-08-17 09:39 kgv Status resolved => reviewed
2017-08-17 12:24 bugmaster Note Added: 0069514
2017-08-17 12:28 bugmaster Note Edited: 0069514
2017-08-17 12:29 bugmaster Note Edited: 0069514
2017-08-17 12:29 bugmaster Status reviewed => tested
2017-08-17 12:30 bugmaster Test case number => de_mesh stl_read D1
2017-08-18 12:53 bugmaster Changeset attached => occt master 22e70738
2017-08-18 12:53 bugmaster Status tested => verified
2017-08-18 12:53 bugmaster Resolution open => fixed
2017-08-18 17:00 git Note Added: 0069615
2017-09-29 16:17 aiv Fixed in Version => 7.2.0
2017-09-29 16:29 aiv Status verified => closed