diff --git a/src/slic3r.cpp b/src/slic3r.cpp index b0b311e04..b7556eae4 100644 --- a/src/slic3r.cpp +++ b/src/slic3r.cpp @@ -154,12 +154,13 @@ main(int argc, char **argv) boost::nowide::cout << "File exported to " << outfile << std::endl; } else if (cli_config.export_svg) { std::string outfile = cli_config.output.value; - if (outfile.empty()) outfile = model.objects.front()->input_file + ".svg"; - - SLAPrint print(&model); - print.config.apply(print_config, true); - print.slice(); - print.write_svg(outfile); + if (outfile.empty()) + outfile = model.objects.front()->input_file + ".svg"; + + SLAPrint print(&model); // initialize print with model + print.config.apply(print_config, true); // apply configuration + print.slice(); // slice file + print.write_svg(outfile); // write SVG boost::nowide::cout << "SVG file exported to " << outfile << std::endl; } else if (cli_config.export_3mf) { std::string outfile = cli_config.output.value; diff --git a/xs/src/libslic3r/SLAPrint.cpp b/xs/src/libslic3r/SLAPrint.cpp index ceb89018e..f6fd69844 100644 --- a/xs/src/libslic3r/SLAPrint.cpp +++ b/xs/src/libslic3r/SLAPrint.cpp @@ -63,7 +63,11 @@ SLAPrint::slice() fill->min_spacing = this->config.get_abs_value("infill_extrusion_width", this->config.layer_height.value); fill->angle = Geometry::deg2rad(this->config.fill_angle.value); fill->density = this->config.fill_density.value/100; - + + // Minimum spacing has a lower bound of > 0. Set to a sane default + // if the user gets an invalid value here. + fill->min_spacing = (fill->min_spacing <= 0 ? 0.5 : fill->min_spacing); + parallelize( 0, this->layers.size()-1,