mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-16 06:51:46 +08:00
#187 allow empty layer setting
This commit is contained in:
parent
0b861f0c51
commit
473dca0884
@ -80,6 +80,7 @@ group:label_width$8:Modifying slices
|
||||
end_line
|
||||
group:Other
|
||||
setting:clip_multipart_objects
|
||||
setting:allow_empty_layers
|
||||
|
||||
page:Infill:infill
|
||||
group:Infill
|
||||
|
@ -645,7 +645,7 @@ std::vector<GCode::LayerToPrint> GCode::collect_layers_to_print(const PrintObjec
|
||||
bool has_extrusions = (layer_to_print.object_layer && layer_to_print.object_layer->has_extrusions())
|
||||
|| (layer_to_print.support_layer && layer_to_print.support_layer->has_extrusions());
|
||||
|
||||
if (has_extrusions && layer_to_print.print_z() > maximal_print_z + 2. * EPSILON)
|
||||
if (!object.print()->config().allow_empty_layers && has_extrusions && layer_to_print.print_z() > maximal_print_z + 2. * EPSILON)
|
||||
throw std::runtime_error(_(L("Empty layers detected, the output would not be printable.")) + "\n\n" +
|
||||
_(L("Object name")) + ": " + object.model_object()->name + "\n" + _(L("Print z")) + ": " +
|
||||
std::to_string(layers_to_print.back().print_z()) + "\n\n" + _(L("This is "
|
||||
|
@ -143,6 +143,14 @@ void PrintConfigDef::init_fff_params()
|
||||
// Maximum extruder temperature, bumped to 1500 to support printing of glass.
|
||||
const int max_temp = 1500;
|
||||
|
||||
def = this->add("allow_empty_layers", coBool);
|
||||
def->label = L("Allow empty layers");
|
||||
def->full_label = L("Allow empty layers");
|
||||
def->category = OptionCategory::slicing;
|
||||
def->tooltip = L("Do not prevent the gcode builder to trigger an exception if a full layer is empty and so the print will have to start from thin air afterward.");
|
||||
def->mode = comExpert;
|
||||
def->set_default_value(new ConfigOptionBool(false));
|
||||
|
||||
def = this->add("avoid_crossing_perimeters", coBool);
|
||||
def->label = L("Avoid crossing perimeters");
|
||||
def->category = OptionCategory::perimeter;
|
||||
|
@ -952,6 +952,7 @@ public:
|
||||
double min_object_distance() const;
|
||||
static double min_object_distance(const ConfigBase *config);
|
||||
|
||||
ConfigOptionBool allow_empty_layers;
|
||||
ConfigOptionBool avoid_crossing_perimeters;
|
||||
ConfigOptionBool avoid_crossing_not_first_layer;
|
||||
ConfigOptionPoints bed_shape;
|
||||
@ -1033,6 +1034,7 @@ protected:
|
||||
{
|
||||
this->MachineEnvelopeConfig::initialize(cache, base_ptr);
|
||||
this->GCodeConfig::initialize(cache, base_ptr);
|
||||
OPT_PTR(allow_empty_layers);
|
||||
OPT_PTR(avoid_crossing_perimeters);
|
||||
OPT_PTR(avoid_crossing_not_first_layer);
|
||||
OPT_PTR(bed_shape);
|
||||
|
@ -426,7 +426,9 @@ const std::vector<std::string>& Preset::print_options()
|
||||
"bottom_solid_min_thickness",
|
||||
"extra_perimeters",
|
||||
"extra_perimeters_odd_layers",
|
||||
"only_one_perimeter_top", "ensure_vertical_shell_thickness", "avoid_crossing_perimeters",
|
||||
"only_one_perimeter_top", "ensure_vertical_shell_thickness",
|
||||
"allow_empty_layers",
|
||||
"avoid_crossing_perimeters",
|
||||
"avoid_crossing_not_first_layer",
|
||||
"thin_perimeters",
|
||||
"thin_walls", "overhangs",
|
||||
|
Loading…
x
Reference in New Issue
Block a user