Skip to content

Commit

Permalink
Update registry.jl
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Larbino1 authored Mar 6, 2024
1 parent d30fbd7 commit 57427aa
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/registry.jl
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,7 @@ function detect_stlbinary(io)
number_of_triangle_blocks = read(io, UInt32)
#1 normal, 3 vertices in Float32 + attrib count, usually 0
len != (number_of_triangle_blocks*size_triangleblock)+size_header && (seekstart(io); return false)
skip(io, number_of_triangle_blocks*size_triangleblock-sizeof(UInt16))
attrib_byte_count = read(io, UInt16) # read last attrib_byte
attrib_byte_count != zero(UInt16) && (seekstart(io); return false) # should be zero as not used
skip(io, number_of_triangle_blocks*size_triangleblock)
result = eof(io) # if end of file, we have a stl!
return result
end
Expand Down

0 comments on commit 57427aa

Please sign in to comment.