FileIO.jl icon indicating copy to clipboard operation
FileIO.jl copied to clipboard

Update registry.jl

Open Larbino1 opened this issue 11 months ago • 4 comments

Change to stl binary/ascii type detection. Removed check on value of final attr bits, which caused a failure to parse for me, incorrectly treating it as an ascii type stl. If the eof is in the correct place, this value does not matter.

@SimonDanisch Maybe as a MeshIO contributor you can give this a quick look? Its a tiny change!

Larbino1 avatar Mar 06 '24 16:03 Larbino1

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.66%. Comparing base (d30fbd7) to head (9ffb6e7).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #388      +/-   ##
==========================================
- Coverage   91.69%   91.66%   -0.03%     
==========================================
  Files          10       10              
  Lines         710      708       -2     
==========================================
- Hits          651      649       -2     
  Misses         59       59              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Mar 06 '24 16:03 codecov[bot]

Could you add a small test file?

SimonDanisch avatar Mar 06 '24 21:03 SimonDanisch

Could you add a small test file?

Yeah sure.

Do you mean:

  • A test in FileIO
  • Checking that detect_stlascii, and detect_stlbinary work
  • By adding to the repo an STL of each type, and testing both

Larbino1 avatar Mar 07 '24 12:03 Larbino1

Add a test file here: https://github.com/JuliaIO/FileIO.jl/blob/d30fbd7d2edb1c234f4a361967e1b063b9dea447/test/query.jl#L356-L366

SimonDanisch avatar Mar 07 '24 13:03 SimonDanisch

@SimonDanisch

I've included the file as a test case. Please let me know if you would like any other work, or if you can support merging.

I guess eventually supporting STLs with attribute data would be nice, but for this specific problem (a binary stl, with nonzero 'attribute byte count' but actually containing no attribute byte data), things work correctly rather than being misconstrued as an ASCII stl.

Larbino1 avatar Mar 08 '24 15:03 Larbino1

Just bumping this again @SimonDanisch @sjkelly

It works, the test is in, the change non-breaking. If there is anything I can do to help get this merged let me know.

Larbino1 avatar Mar 15 '24 15:03 Larbino1