diff --git a/tests/hollowing/CMakeLists.txt b/tests/hollowing/CMakeLists.txt index e6f01b0e8..79c12baef 100644 --- a/tests/hollowing/CMakeLists.txt +++ b/tests/hollowing/CMakeLists.txt @@ -1,8 +1,9 @@ if(TARGET OpenVDB::openvdb) add_executable(hollowing_tests hollowing_tests.cpp) - find_package(GTest REQUIRED) - - target_link_libraries(hollowing_tests libslic3r OpenVDB::openvdb GTest::GTest GTest::Main) - target_compile_definitions(hollowing_tests PRIVATE TEST_DATA_DIR=R"\(${TEST_DATA_DIR}\)") + #find_package(GTest REQUIRED) + #target_link_libraries(hollowing_tests libslic3r OpenVDB::openvdb GTest::GTest GTest::Main) + #target_compile_definitions(hollowing_tests PRIVATE TEST_DATA_DIR=R"\(${TEST_DATA_DIR}\)") + + target_link_libraries(hollowing_tests test_common libslic3r OpenVDB::openvdb) endif() diff --git a/tests/hollowing/hollowing_tests.cpp b/tests/hollowing/hollowing_tests.cpp index 2ba61a63d..846f7e831 100644 --- a/tests/hollowing/hollowing_tests.cpp +++ b/tests/hollowing/hollowing_tests.cpp @@ -1,8 +1,9 @@ #include -#include +#include #include #include +#include #include #include "libslic3r/Format/OBJ.hpp" @@ -36,14 +37,25 @@ static Slic3r::TriangleMesh load_model(const std::string &obj_filename) return mesh; } -TEST(Hollowing, LoadObject) { +TEST_CASE("Load object", "[Hollowing]") { TriangleMeshDataAdapter mesh{load_model("20mm_cube.obj")}; auto ptr = openvdb::tools::meshToVolume(mesh, {}); - ASSERT_TRUE(ptr); + REQUIRE(ptr); + + std::vector points; + std::vector quad_indices; + std::vector triangle_indices; + + openvdb::tools::volumeToMesh(*ptr, points, triangle_indices, quad_indices, 0.0, 1.0, true); + + std::cout << "Triangle count: " << triangle_indices.size() << std::endl; + std::cout << "Quad count: " << quad_indices.size() << std::endl; + std::cout << "Point count: " << points.size() << " vs " << mesh.mesh.its.vertices.size() << std::endl; } -int main(int argc, char **argv) { - ::testing::InitGoogleTest(&argc, argv); - return RUN_ALL_TESTS(); -} +//int main(int argc, char **argv) +//{ +// ::testing::InitGoogleTest(&argc, argv); +// return RUN_ALL_TESTS(); +//}