This commit is contained in:
QIDI TECH
2024-09-03 09:34:33 +08:00
parent 27f34aa3e8
commit 585146181b
5147 changed files with 1734881 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
add_executable(meshboolean MeshBoolean.cpp)
target_link_libraries(meshboolean libslic3r)
if (WIN32)
prusaslicer_copy_dlls(meshboolean)
endif()

View File

@@ -0,0 +1,43 @@
#include <iostream>
#include <vector>
#include <libslic3r/TriangleMesh.hpp>
#include <libslic3r/Model.hpp>
#include <libslic3r/SLAPrint.hpp>
#include <libslic3r/SLAPrintSteps.hpp>
#include <libslic3r/MeshBoolean.hpp>
#include <libnest2d/tools/benchmark.h>
#include <boost/log/trivial.hpp>
int main(const int argc, const char * argv[])
{
using namespace Slic3r;
if (argc <= 1) {
std::cout << "Usage: meshboolean <input_file.3mf>" << std::endl;
return EXIT_FAILURE;
}
TriangleMesh input;
input.ReadSTLFile(argv[1]);
Benchmark bench;
bench.start();
bool fckd = MeshBoolean::cgal::does_self_intersect(input);
bench.stop();
std::cout << "Self intersect test: " << fckd << " duration: " << bench.getElapsedSec() << std::endl;
bench.start();
MeshBoolean::self_union(input);
bench.stop();
std::cout << "Self union duration: " << bench.getElapsedSec() << std::endl;
return 0;
}