blob: b11486f90aebd5eb8c7dc7bd7ea82d766a4bc774 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#include <iostream>
#include <string>
#include <libslic3r.h>
#include "TriangleMesh.hpp"
#include "SLABasePool.hpp"
#include "benchmark.h"
const std::string USAGE_STR = {
"Usage: slabasebed stlfilename.stl"
};
void confess_at(const char * /*file*/,
int /*line*/,
const char * /*func*/,
const char * /*pat*/,
...) {}
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;
sla::ground_layer(model, ground_slice, 0.1f);
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;
}
|