-
Notifications
You must be signed in to change notification settings - Fork 1k
Added binary STL support. #802
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR. STL support would be great! There are a few concerns I had that I would like to see addressed before we merge this though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. I added a single comment to those left by @ondys, but please fix the copyright year in the file comment headers throughout your PR. It's boring, but it's necessary.
Also, some simple decode and encode tests would be a great addition to this PR before we accept it. In depth coverage of every STL feature and every line of code in this PR is not required, but some basic tests are needed. The tests for the other decoders/encoders in the draco/io directory should serve as a guide-- basically, simple succeed/fail tests that can be used to confirm basic feature correctness will be sufficient.
And one last note: Please update your branch when you have the time to do so: I've made some changes to the Github CI integration for Draco, and this PR needs to be updated to pick up the correct test config. Thanks again! |
I haven't forgotten about this task, just need some more time. |
Done |
Added ASCII STL detection and proper error message. Made StlEncoder methods return Status instead of bool. Added better error messages using Status. Added better header writing (using setw). Added STL testdata created from the existing testdata using Blender.
…he input mesh: normalize(cross(p2-p1, p3-p1))
Is the pull request good now? Anything else I can do? |
Moved ASCII STL detection code to DecodeFromBuffer. Removed normal attribute usage in stl_encoder, normals are now always calculated. Used Vector3f instead of ugly manual vector math code.
Another day, another commit... :-) |
On a side note I want to say thank you for being so patient with and supportive of me. Much appreciated! This is a great project! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, code looks good to me. One remaining thing would be to add a very simple unit test for the _encoder and _decoder. I see that you added test files but I don't see the unit tests themselves. E.g. you can check unit tests ply_encoder_test.cc
+ ply_decoder_test.cc
for examples how to do it + cmake\draco_tests.cmake
to actually build them / integrate them. Note that a very simple test that verifies that model is loaded / saved should be sufficient for now.
Done and done! :-) |
Used DRACO_ASSIGN_OR_ASSERT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks good. We will try to merge in the near future. Thanks for the PR!
Hello, I am looking for documentation on STL I/O <-> Draco support. |
It would also be nice to have a general idea of compression ratio between binary STL -> Draco, and ASCII STL -> Draco. |
Hello, I was able to build the draco binaries for Linux with the BUILDING instructions. I then used the command:
Here is a simple compression "ratio" overview (compressed file size / original file size): I have noticed that the original STL file and the encoded+decoded STL file are both binary, have the overall same file size (31MB), but they differ using the How can we be sure that there is no information / mesh loss in the STL->draco->STL encoding/decoding pipeline? |
Overview of my build_dir for curious people, the building process was fast and simple, with no dependencies to install on my end, thank you:
|
I opened a new PR just for mentioning working STL support in README. Should there be other places where to mention it? The npm Draco support for STL question is still lingering also. |
|
Reminder for later on STL files (before Draco i/o, after Draco i/o) lossless comparison (with Meshlab or Cloudcompare): |
Draco is a lossy compression method, you can't compare STL before and after... |
not even with quantization=0? |
@rhulha No, obviously Draco is not lossless if need be: https://github.com/google/draco/search?q=lossless&type=code #878 #933 |
Co-authored-by: Ondrej Stava <ondys@users.noreply.github.com>
Includes support for binary STL and some basic tests.
…#959) Co-authored-by: Ondrej Stava <ondys@users.noreply.github.com>
Hello all,
I am trying to add binary STL format to Draco.
STL is an incredibly simple single mesh 3D file format and it would be a perfect addition to Draco due to its popularity and large file size.
Some basic tests seem to work great.
Please let me know if I am going into the right direction.
This fixes: #773