mirror of
https://github.com/QIDITECH/QIDIStudio.git
synced 2026-01-30 16:38:41 +03:00
update
This commit is contained in:
7
sandboxes/meshboolean/CMakeLists.txt
Normal file
7
sandboxes/meshboolean/CMakeLists.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
add_executable(meshboolean MeshBoolean.cpp)
|
||||
|
||||
target_link_libraries(meshboolean libslic3r)
|
||||
|
||||
if (WIN32)
|
||||
prusaslicer_copy_dlls(meshboolean)
|
||||
endif()
|
||||
43
sandboxes/meshboolean/MeshBoolean.cpp
Normal file
43
sandboxes/meshboolean/MeshBoolean.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user