Thanks for deciding to contribute to meshoptimizer! These guidelines will try to help make the process painless and efficient.
If you have a question regarding the library usage, please create a GitHub discussion. Some questions just need answers, but it's nice to keep them for future reference in case other people want to know the same thing. Some questions help improve the library interface or documentation by inspiring future changes.
If the library doesn't compile on your system, compiles with warnings, doesn't seem to run correctly for your input data or if anything else is amiss, please open a GitHub issue. It helps if you note the version of the library this issue happens in, the version of your compiler for compilation issues, and a reproduction case for runtime bugs.
Of course, feel free to create a pull request to fix the bug yourself.
New algorithms and improvements to existing algorithms are always welcome; please open an issue describing an improvement you'd like to see or make before opening a pull request.
This will give us a chance to discuss the idea before implementing it - some algorithms may not be easy to integrate into existing programs, may not be robust to arbitrary meshes or may be expensive to run or implement/maintain, so a discussion helps make sure these don't block the algorithm development.
Contributions to this project are expected to follow the existing code style.
.clang-format file mostly defines syntactic styling rules (you can run make format to format the code accordingly).
As for naming conventions, this library uses snake_case for variables, lowerCamelCase for functions, UpperCamelCase for types, kCamelCase for global constants and SCARY_CASE for macros. All public functions/types must additionally have an extra meshopt_ prefix to avoid symbol conflicts.
Please note that this library uses C89 interface for all APIs and a C++11 implementation. Additionally, the library code has zero external dependencies, does not depend on STL and does not use RTTI or exceptions. This maximizes compatibility and makes sure the library can be used in environments where STL use is discouraged or prohibited, as well as maximizing runtime performance and minimizing compilation times.
gltfpack and demo code (tests, clusterlod.h) use memory-friendly STL containers like std::vector when appropriate, which does not affect the library users.
gltfpack additionally vendors cgltf and fast_obj dependencies, and can be optionally compiled against externally provided basis_universal or libwebp.
All pull requests will run through a continuous integration pipeline using GitHub Actions that will run the built-in unit tests and integration tests on Windows, macOS and Linux with GCC, Clang and MSVC compilers.
You can run the tests yourself using make test or building the demo program with cmake -DBUILD_DEMO=ON and running it.
Unit tests can be found in demo/tests.cpp and functional tests - in demo/main.cpp; when making code changes please try to make sure they are covered by an existing test or add a new test accordingly.
Documentation for this library resides in the meshoptimizer.h header, with examples as part of a usage manual available in README.md.
Changes to documentation are always welcome and should use issues/pull requests as outlined above; please note that README.md may omit documentation for experimental algorithms as they may change the interface without concern for backwards compatibility.
If you prefer to not disclose the issues or information relevant to the issue such as reproduction case to the public, you can always contact the author via e-mail (arseny.kapoulkine@gmail.com).
Any code you submit will become part of the repository and be distributed under the meshoptimizer license. By submitting code to the project you agree that the code is your work and that you can give it to the project.
You also agree by submitting your code that you grant all transferrable rights to the code to the project maintainer, including for example re-licensing the code, modifying the code, and distributing it in source or binary forms. Specifically, this includes a requirement that you assign copyright to the project maintainer.
AI-generated issues or pull requests (including pull request descriptions), will be closed. Repeat submissions may result in a ban.