Closed Floppy closed 2 weeks ago
Binary support added in now as well.
Converted to draft for a little while, I've got an error in the example code or model. Just working that out now.
Looks like it's reading files with EOL conversion somewhere, rather than just as straight binary. Just trying to find out where that's happening.
OK, all good now. Tests pass including an EOL conversion test, and the example runs too.
If you're happy with it, merge away :)
Woohoo, green!
I've optimised the loader so it combines vertices on the fly during load - this should be more CPU and memory efficient when loading (which I'm doing a lot).
Incidentally, this loader code is now active in the latest release of Manyfold (https://manyfold.app), where I'm using it for checking for mesh holes. It's using my fork, in advance of this making it into an official Mittsu release.
This PR adds a loader for STLs, currently ASCII encoding only. Binary support will be following shortly, either in this PR or a followup.
STL is a pretty simple format, so there's not a lot in the way of tests, but I've tried to cover what edge cases I can think of. STLs are always triangles, so there's no quad support like the OBJ loader has.
Part of #116