Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update registry.jl #388

Merged
merged 2 commits into from
Mar 16, 2024
Merged

Update registry.jl #388

merged 2 commits into from
Mar 16, 2024

Conversation

Larbino1
Copy link
Contributor

@Larbino1 Larbino1 commented Mar 6, 2024

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!

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.
Copy link

codecov bot commented Mar 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SimonDanisch
Copy link
Member

Could you add a small test file?

@Larbino1
Copy link
Contributor Author

Larbino1 commented Mar 7, 2024

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

@SimonDanisch
Copy link
Member

Add a test file here:

FileIO.jl/test/query.jl

Lines 356 to 366 in d30fbd7

@testset "STL detection" begin
q = query(joinpath(file_dir, "ascii.stl"))
@test typeof(q) <: File{format"STL_ASCII"}
q = query(joinpath(file_dir, "binary_stl_from_solidworks.STL"))
@test typeof(q) <: File{format"STL_BINARY"}
open(q) do io
@test position(io) == 0
skipmagic(io)
@test position(io) == 0 # no skipping for functions
end
end

…ctual attribute data. Should match as a binary STL, rather than an ASCII STL.
@Larbino1
Copy link
Contributor Author

Larbino1 commented Mar 8, 2024

@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
Copy link
Contributor Author

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.

@SimonDanisch SimonDanisch merged commit b7259eb into JuliaIO:master Mar 16, 2024
19 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants