mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-28 11:11:16 -06:00
Merge branch 'master' of https://github.com/Prusa3d/Slic3r
This commit is contained in:
commit
2a7e5bc0ae
12 changed files with 57 additions and 7 deletions
|
|
@ -2566,6 +2566,14 @@ void PrintConfigDef::init_sla_params()
|
|||
def->enum_labels.push_back(L("Dynamic"));
|
||||
def->default_value = new ConfigOptionEnum<SLAPillarConnectionMode>(slapcmDynamic);
|
||||
|
||||
def = this->add("support_buildplate_only", coBool);
|
||||
def->label = L("Support on build plate only");
|
||||
def->category = L("Supports");
|
||||
def->tooltip = L("Only create support if it lies on a build plate. Don't create support on a print.");
|
||||
def->cli = "support-buildplate-only!";
|
||||
def->mode = comSimple;
|
||||
def->default_value = new ConfigOptionBool(false);
|
||||
|
||||
def = this->add("support_pillar_widening_factor", coFloat);
|
||||
def->label = L("Pillar widening factor");
|
||||
def->category = L("Supports");
|
||||
|
|
|
|||
|
|
@ -976,6 +976,9 @@ public:
|
|||
// How the pillars are bridged together
|
||||
ConfigOptionEnum<SLAPillarConnectionMode> support_pillar_connection_mode;
|
||||
|
||||
// Generate only ground facing supports
|
||||
ConfigOptionBool support_buildplate_only;
|
||||
|
||||
// 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
|
||||
|
|
@ -1031,6 +1034,7 @@ protected:
|
|||
OPT_PTR(support_head_width);
|
||||
OPT_PTR(support_pillar_diameter);
|
||||
OPT_PTR(support_pillar_connection_mode);
|
||||
OPT_PTR(support_buildplate_only);
|
||||
OPT_PTR(support_pillar_widening_factor);
|
||||
OPT_PTR(support_base_diameter);
|
||||
OPT_PTR(support_base_height);
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -1898,6 +1898,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.
|
||||
|
|
|
|||
|
|
@ -55,6 +55,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
|
||||
|
|
|
|||
|
|
@ -363,7 +363,11 @@ SLAPrint::ApplyStatus SLAPrint::apply(const Model &model, const DynamicPrintConf
|
|||
const_cast<PrintObjectStatus&>(*it_print_object_status).status = PrintObjectStatus::Reused;
|
||||
} else {
|
||||
auto print_object = new SLAPrintObject(this, &model_object);
|
||||
|
||||
// FIXME: this invalidates the transformed mesh in SLAPrintObject
|
||||
// which is expensive to calculate (especially the raw_mesh() call)
|
||||
print_object->set_trafo(sla_trafo(model_object));
|
||||
|
||||
print_object->set_instances(new_instances);
|
||||
print_object->config_apply(config, true);
|
||||
print_objects_new.emplace_back(print_object);
|
||||
|
|
@ -415,6 +419,7 @@ sla::SupportConfig make_support_cfg(const SLAPrintObjectConfig& c) {
|
|||
case slapcmDynamic:
|
||||
scfg.pillar_connection_mode = sla::PillarConnectionMode::dynamic; break;
|
||||
}
|
||||
scfg.ground_facing_only = c.support_buildplate_only.getBool();
|
||||
scfg.pillar_widening_factor = c.support_pillar_widening_factor.getFloat();
|
||||
scfg.base_radius_mm = 0.5*c.support_base_diameter.getFloat();
|
||||
scfg.base_height_mm = c.support_base_height.getFloat();
|
||||
|
|
@ -620,8 +625,8 @@ void SLAPrint::process()
|
|||
// repeated)
|
||||
|
||||
if(!po.m_supportdata || !po.m_supportdata->support_tree_ptr) {
|
||||
BOOST_LOG_TRIVIAL(warning) << "Uninitialized support data at "
|
||||
<< "pad creation.";
|
||||
BOOST_LOG_TRIVIAL(error) << "Uninitialized support data at "
|
||||
<< "pad creation.";
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -643,9 +648,11 @@ void SLAPrint::process()
|
|||
// This call can get pretty time consuming
|
||||
auto thrfn = [this](){ throw_if_canceled(); };
|
||||
|
||||
if(elevation < pad_h)
|
||||
if(elevation < pad_h) {
|
||||
// we have to count with the model geometry for the base plate
|
||||
sla::base_plate(trmesh, bp, float(pad_h), float(lh),
|
||||
thrfn);
|
||||
}
|
||||
|
||||
pcfg.throw_on_cancel = thrfn;
|
||||
po.m_supportdata->support_tree_ptr->add_pad(bp, pcfg);
|
||||
|
|
@ -939,7 +946,7 @@ void SLAPrint::process()
|
|||
};
|
||||
|
||||
// this would disable the rasterization step
|
||||
// m_stepmask[slapsRasterize] = false;
|
||||
// m_stepmask[slapsRasterize] = false;
|
||||
|
||||
double pstd = (100 - max_objstatus) / 100.0;
|
||||
st = max_objstatus;
|
||||
|
|
@ -1063,6 +1070,7 @@ bool SLAPrintObject::invalidate_state_by_config_options(const std::vector<t_conf
|
|||
|| opt_key == "support_head_width"
|
||||
|| opt_key == "support_pillar_diameter"
|
||||
|| opt_key == "support_pillar_connection_mode"
|
||||
|| opt_key == "support_buildplate_only"
|
||||
|| opt_key == "support_base_diameter"
|
||||
|| opt_key == "support_base_height"
|
||||
|| opt_key == "support_critical_angle"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue