Added cancellation points to pad creation step.

This commit is contained in:
tamasmeszaros 2018-12-11 15:54:54 +01:00
parent e1cea03cda
commit b31c62e044
7 changed files with 102 additions and 55 deletions

View file

@ -2,6 +2,7 @@
#define SLABASEPOOL_HPP
#include <vector>
#include <functional>
namespace Slic3r {
@ -11,12 +12,14 @@ class TriangleMesh;
namespace sla {
using ExPolygons = std::vector<ExPolygon>;
using ThrowOnCancel = std::function<void(void)>;
/// Calculate the polygon representing the silhouette from the specified height
void base_plate(const TriangleMesh& mesh,
ExPolygons& output,
float zlevel = 0.1f,
float layerheight = 0.05f);
void base_plate(const TriangleMesh& mesh, // input mesh
ExPolygons& output, // Output will be merged with
float zlevel = 0.1f, // Plate creation level
float layerheight = 0.05f, // The sampling height
ThrowOnCancel thrfn = [](){}); // Will be called frequently
struct PoolConfig {
double min_wall_thickness_mm = 2;
@ -24,6 +27,8 @@ struct PoolConfig {
double max_merge_distance_mm = 50;
double edge_radius_mm = 1;
ThrowOnCancel throw_on_cancel = [](){};
inline PoolConfig() {}
inline PoolConfig(double wt, double wh, double md, double er):
min_wall_thickness_mm(wt),
@ -35,8 +40,7 @@ struct PoolConfig {
/// Calculate the pool for the mesh for SLA printing
void create_base_pool(const ExPolygons& base_plate,
TriangleMesh& output_mesh,
const PoolConfig& = PoolConfig()
);
const PoolConfig& = PoolConfig());
/// TODO: Currently the base plate of the pool will have half the height of the
/// whole pool. So the carved out space has also half the height. This is not