Merge remote-tracking branch 'remotes/origin/master' into lm_sla_supports_auto2

This commit is contained in:
bubnikv 2019-02-06 11:11:51 +01:00
commit d31cb98fe9
59 changed files with 7616 additions and 364 deletions

View file

@ -427,6 +427,7 @@ ExPolygons concave_hull(const ExPolygons& polys, double max_dist_mm = 50,
return r;
});
// This is unavoidable...
punion = unify(punion);
return punion;
@ -448,10 +449,17 @@ void base_plate(const TriangleMesh &mesh, ExPolygons &output, float h,
slicer.slice(heights, &out, thrfn);
size_t count = 0; for(auto& o : out) count += o.size();
// Now we have to unify all slice layers which can be an expensive operation
// so we will try to simplify the polygons
ExPolygons tmp; tmp.reserve(count);
for(auto& o : out) for(auto& e : o) tmp.emplace_back(std::move(e));
for(ExPolygons& o : out) for(ExPolygon& e : o) {
auto&& exss = e.simplify(0.1/SCALING_FACTOR);
for(ExPolygon& ep : exss) tmp.emplace_back(std::move(ep));
}
ExPolygons utmp = unify(tmp);
for(auto& o : utmp) {
auto&& smp = o.simplify(0.1/SCALING_FACTOR);
output.insert(output.end(), smp.begin(), smp.end());

View file

@ -1907,6 +1907,17 @@ bool SLASupportTree::generate(const PointSet &points,
}
};
if(cfg.ground_facing_only) { // Delete the non-gnd steps if necessary
program[ROUTING_NONGROUND] = []() {
BOOST_LOG_TRIVIAL(info) << "Skipping non-ground facing supports as "
"requested.";
};
program[HEADLESS] = [](){
BOOST_LOG_TRIVIAL(info) << "Skipping headless stick generation as "
"requested";
};
}
Steps pc = BEGIN, pc_prev = BEGIN;
// Let's define a simple automaton that will run our program.

View file

@ -58,6 +58,9 @@ struct SupportConfig {
// How to connect pillars
PillarConnectionMode pillar_connection_mode = PillarConnectionMode::dynamic;
// Only generate pillars that can be routed to ground
bool ground_facing_only = false;
// TODO: unimplemented at the moment. This coefficient will have an impact
// when bridges and pillars are merged. The resulting pillar should be a bit
// thicker than the ones merging into it. How much thicker? I don't know