mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-05-14 13:02:39 -07:00
Importing the SLA computing module into the native source tree.
This commit is contained in:
2
sandboxes/slabasebed/CMakeLists.txt
Normal file
2
sandboxes/slabasebed/CMakeLists.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
add_executable(slabasebed EXCLUDE_FROM_ALL slabasebed.cpp)
|
||||
target_link_libraries(slabasebed libslic3r)
|
||||
43
sandboxes/slabasebed/slabasebed.cpp
Normal file
43
sandboxes/slabasebed/slabasebed.cpp
Normal file
@@ -0,0 +1,43 @@
|
||||
#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"
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user