trimesh2d: add library for simple polygon triangulation in linear time

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-09-14 20:27:34 -07:00 committed by Stephen Gutekanst
parent d7d0aa116c
commit 9df6448109
11 changed files with 553 additions and 0 deletions

25
libs/trimesh2d/build.zig Normal file
View file

@ -0,0 +1,25 @@
const std = @import("std");
pub fn build(b: *std.build.Builder) void {
const mode = b.standardReleaseOptions();
const lib = b.addStaticLibrary("trimesh2d", "src/main.zig");
lib.setBuildMode(mode);
lib.install();
var main_tests = b.addTest("src/main.zig");
main_tests.setBuildMode(mode);
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&main_tests.step);
_ = pkg;
}
pub const pkg = std.build.Pkg{
.name = "trimesh2d",
.source = .{ .path = thisDir() ++ "/src/main.zig" },
};
fn thisDir() []const u8 {
return std.fs.path.dirname(@src().file) orelse ".";
}