Sorry, something went wrong.
|
@copilot Implement MWT_Greedy_Algorithm https://github.com/drmasifhabib/MWT_Greedy_Algorithm |
Sorry, something went wrong.
|
@copilot Implement MWT_Greedy_Algorithm https://github.com/drmasifhabib/MWT_Greedy_Algorithm Implemented the MWT Greedy Algorithm from drmasifhabib/MWT_Greedy_Algorithm in commit d174bce. The algorithm is available as a new triangulation method via config.triangulation_method = "mwt" (or "greedy"). It implements the directional greedy approach:
Added TINYOBJLOADER_TRIANGULATE_MWT constant and 5 test cases (quad, pentagon, hexagon, preserve_quads, file load). All 55+ tests pass. |
Sorry, something went wrong.
|
@copilot make triangulation implementation separate file so that we can test the algorithm standalone manner before integrating to tinyobjloader. put files to sandbox/triangulation/ |
Sorry, something went wrong.
|
@copilot make triangulation implementation separate file so that we can test the algorithm standalone manner before integrating to tinyobjloader. put files to sandbox/triangulation/ Created sandbox/triangulation/ with standalone files in commit 4c91a3c:
The algorithms match the implementations in tiny_obj_loader.h but are fully independent and testable standalone. |
Sorry, something went wrong.
|
@copilot Implement our own Sweep-Line and Earcut(with zcurve) algorithm and also make benchmark program to test each triangulation algorithm. |
Sorry, something went wrong.
|
@copilot Implement our own Sweep-Line and Earcut(with zcurve) algorithm and also make benchmark program to test each triangulation algorithm. Implemented in commits 2cd27a7 and 57156fa. Added to sandbox/triangulation/: Sweep-Line (TriangulateSweepLine):
Earcut Z-Curve (TriangulateEarcutZCurve):
Benchmark (benchmark.cc, run with make bench):
14 new test cases (38 total standalone tests), all passing. 0 CodeQL alerts. |
Sorry, something went wrong.
The ObjReaderConfig::triangulation_method field was declared but never used. This PR makes it functional, adds a preserve_quads option for quad+triangle decomposition, implements the MWT (Minimum Weight Triangulation) greedy algorithm, and adds standalone sweep-line and earcut Z-curve triangulation algorithms with a benchmark program.
API changes
MWT Greedy Algorithm
The MWT greedy algorithm implements the directional greedy approach described in "A Linear-Time Greedy Algorithm with Directional Optimization for Near-Optimal Minimum Weight Triangulation of Convex Polygons":
Standalone triangulation sandbox
Five triangulation algorithms are extracted into standalone files under sandbox/triangulation/ for independent testing and evaluation without any tinyobjloader dependency:
Internals
Usage
Tests
15 new tinyobjloader test cases: fan/earclip/mwt on quads and pentagons, mwt on hexagons, preserve_quads with multiple methods, no-triangulation passthrough, default config values, string aliases, v1 API backward compat, and mwt file-based loading. Plus 38 standalone tests in sandbox/triangulation/ covering all five algorithms.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.