From b4caa051fee59c82c8e6c49a70d804e03b175074 Mon Sep 17 00:00:00 2001 From: mckay Date: Mon, 20 Oct 2025 19:59:01 +0800 Subject: [PATCH] feat: mesh area and volumn std - used to compare with integrating results --- application/main.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/application/main.cpp b/application/main.cpp index c764b6e..deebf33 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -3,6 +3,7 @@ #include +#include #include #include @@ -46,7 +47,7 @@ int main() auto runtime_blobtree = create_blobtree(); auto node_iter1 = blobtree_add_primitive_node(runtime_blobtree, cylinder); auto node_iter2 = blobtree_add_primitive_node(runtime_blobtree, sphere1); - auto node_iter3 = blobtree_add_operation_node(runtime_blobtree, node_iter1, node_iter2, INTERSECTION_OP); + auto node_iter3 = blobtree_add_operation_node(runtime_blobtree, node_iter1, node_iter2, UNION_OP); auto baked_blobtree = bake_blobtree(runtime_blobtree); destroy_blobtree(runtime_blobtree); @@ -60,6 +61,11 @@ int main() auto result = generate_polymesh(solver); write_obj(result.mesh, "output.obj"); + double area = compute_surface_area(&result.mesh); + double volume = compute_volume(&result.mesh); + + std::cout << "area: " << area << std::endl; // expected: 6 + std::cout << "volume: " << volume << std::endl; // expected: 1 print_statistics(solver); destroy_solver(solver);