Closed dreammaker closed 9 years ago
Can you attach the file in question? Maybe MeshesIO will help?
cc @SimonDanisch
FWIW this is how Cura disambiguates: https://github.com/Ultimaker/CuraEngine/blob/160612f0dc09f3084d7d7aec6b6147e5f391af7b/src/MeshGroup.cpp#L105-L136
This is solved in MeshIO + FileIO: https://github.com/JuliaIO/FileIO.jl/blob/sd/improvements/src/registry.jl#L153
Hope we can publish this soon!
Without actually running it, it looks like both of the above links to Cura and MeshIO have this bug also. They both check for the string "solid" and if found, assume the file is ascii. This will fail. From what I can tell, SolidWorks is treating the header as a comment.
See Blender's source for a version that would work.
I'll see if I can get an example export that I can upload.
that's actually not true for detect_stlbinary... If it detects "solid ", it knows its not binary... ;) the detection of ascii is independant of this (though probably not correct).
Hm, yeah but you're still right, that this might fail. I can remove that line!
So, any pull requests are welcome to improve the detection ;)
GitHub doesn't seem to allow arbitrary files in comments. I made a branch with an example file and a failing test. I'll make a patch and pull request when I have time. I think the issue should be open in the meantime.
Nice, thank you =) Would you mind creating the PR in MeshIO though? IO in Meshes.jl should be deprecated soon.
Okay I included it into FileIO and MeshIO :D
Nice, @SimonDanisch! That was quick!
I'm probably going to still backport your fix here to Meshes.jl.
Should be fixed in the 0.1.x branch
We are currently misidentifying binary stl format as ascii stl, which is causing this error. SolidWorks, in particular, exports binary stl files with the string "solid" in the header. Since the 80-byte header can be anything in the binary format, it shouldn't be used to determine the format.
This is the backtrace I'm seeing.