26 std::cout <<
"Apply boolean union, intersection or subtraction"
29 std::cout <<
"Usage: "
31 <<
" union|inter|minus mesh_file_1 mesh_file_2"
32 " [reference_mesh_file]"
34 std::cout <<
"Example: "
37 " ../Testing/Data/CubeTriangleFaces.off"
38 " ../Testing/Data/tetra.off"
39 " ../Testing/Data/boolean_operations/mepp1_cube_tetra_union.off"
46 int main(
int argc,
const char **argv)
49 if(argc < 4 || argc > 5)
53 std::string operation = argv[1];
54 if(operation !=
"union" && operation !=
"inter" && operation !=
"minus")
58 std::string input_file_1 = argv[2];
59 std::string input_file_2 = argv[3];
60 std::string reference_file;
62 reference_file = argv[4];
63 std::string output_file =
64 "test_boolean_operations_polyhedron_" + operation +
".off";
67 std::cout <<
"\nParameters summary:" << std::endl;
68 std::cout <<
" - operation : " << operation << std::endl;
69 std::cout <<
" - input file 1 : " << input_file_1 << std::endl;
70 std::cout <<
" - input file 2 : " << input_file_2 << std::endl;
71 std::cout <<
" - reference file: " << reference_file << std::endl;
72 std::cout <<
"\nOutput in " << output_file << std::endl;
87 std::cout <<
"Running boolean operation" + operation +
"..." << std::endl;
88 if(operation ==
"union")
90 else if(operation ==
"inter")
99 if(reference_file.empty())
101 std::cout <<
"No reference file provided, skipping result check."
106 std::cout <<
"Checking result with reference file..." << std::endl;
114 std::cout <<
"Boolean operation " + operation +
" successfully tested."
119 std::cout <<
"Boolean operation " + operation +
" FAILED!" << std::endl;