2018-08-16 15:47:05 +00:00
|
|
|
#include <iostream>
|
|
|
|
#include <string>
|
|
|
|
|
2018-12-11 14:54:54 +00:00
|
|
|
#include <libslic3r/libslic3r.h>
|
|
|
|
#include <libslic3r/TriangleMesh.hpp>
|
|
|
|
#include <libslic3r/SLA/SLABasePool.hpp>
|
|
|
|
#include <libnest2d/tools/benchmark.h>
|
2018-08-16 15:47:05 +00:00
|
|
|
|
|
|
|
const std::string USAGE_STR = {
|
|
|
|
"Usage: slabasebed stlfilename.stl"
|
|
|
|
};
|
|
|
|
|
|
|
|
int main(const int argc, const char *argv[]) {
|
|
|
|
using namespace Slic3r;
|
|
|
|
using std::cout; using std::endl;
|
|
|
|
|
|
|
|
if(argc < 2) {
|
|
|
|
cout << USAGE_STR << endl;
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
TriangleMesh model;
|
|
|
|
Benchmark bench;
|
|
|
|
|
|
|
|
model.ReadSTLFile(argv[1]);
|
|
|
|
model.align_to_origin();
|
|
|
|
|
|
|
|
ExPolygons ground_slice;
|
|
|
|
TriangleMesh basepool;
|
|
|
|
|
2018-12-11 14:54:54 +00:00
|
|
|
sla::base_plate(model, ground_slice, 0.1f);
|
2018-08-16 15:47:05 +00:00
|
|
|
|
|
|
|
bench.start();
|
|
|
|
sla::create_base_pool(ground_slice, basepool);
|
|
|
|
bench.stop();
|
|
|
|
|
|
|
|
cout << "Base pool creation time: " << std::setprecision(10)
|
|
|
|
<< bench.getElapsedSec() << " seconds." << endl;
|
|
|
|
|
|
|
|
basepool.write_ascii("out.stl");
|
|
|
|
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|