Skip to content

Commit 4c91a3c

Browse files
Copilotsyoyo
andcommitted
Extract triangulation algorithms into standalone sandbox/triangulation/ files
Create self-contained header (triangulation.h) with fan, earclip, and MWT greedy algorithms that can be tested independently of tinyobjloader. Add standalone test program (main.cc) with 24 test cases covering all three algorithms, 3D vertices, edge cases, and weight optimization. Add Makefile for standalone build/test. Co-authored-by: syoyo <18676+syoyo@users.noreply.github.com>
1 parent c772dca commit 4c91a3c

4 files changed

Lines changed: 923 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ build/
66
/python/tiny_obj_loader.h
77
/tests/tester
88
/tests/tester.dSYM
9+
/sandbox/triangulation/triangulation_test
910
/_codeql_build_dir/
1011
/_codeql_detected_source_root
1112
/python/_version.py

sandbox/triangulation/Makefile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Makefile for standalone triangulation algorithm testing.
2+
#
3+
# Usage:
4+
# make — build the test binary
5+
# make test — build and run all tests
6+
# make clean — remove build artifacts
7+
8+
CXX ?= g++
9+
CXXFLAGS ?= -std=c++11 -O2 -Wall -Wextra
10+
TARGET = triangulation_test
11+
12+
.PHONY: all test clean
13+
14+
all: $(TARGET)
15+
16+
$(TARGET): main.cc triangulation.h
17+
$(CXX) $(CXXFLAGS) -o $@ main.cc
18+
19+
test: $(TARGET)
20+
./$(TARGET)
21+
22+
clean:
23+
rm -f $(TARGET)

0 commit comments

Comments
 (0)