From 6a1a3fc94c4a07517f82a2a9cacbad5dec03adf5 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Thu, 1 Dec 2016 17:30:06 +0100 Subject: [PATCH] SLAPrintConfig needs other defaults --- xs/src/libslic3r/PrintConfig.hpp | 8 ++++++++ xs/src/libslic3r/SLAPrint.cpp | 7 +++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp index 37e376114..4e7f14e16 100644 --- a/xs/src/libslic3r/PrintConfig.hpp +++ b/xs/src/libslic3r/PrintConfig.hpp @@ -549,6 +549,14 @@ class SLAPrintConfig SLAPrintConfig() : StaticPrintConfig() { this->set_defaults(); + + // override some defaults + this->fill_density.value = 100; + this->fill_pattern.value = ipGrid; + this->infill_extrusion_width.value = 0.5; + this->infill_extrusion_width.percent = false; + this->perimeter_extrusion_width.value = 1; + this->perimeter_extrusion_width.percent = false; }; virtual ConfigOption* optptr(const t_config_option_key &opt_key, bool create = false) { diff --git a/xs/src/libslic3r/SLAPrint.cpp b/xs/src/libslic3r/SLAPrint.cpp index 9704cff52..3fb05e442 100644 --- a/xs/src/libslic3r/SLAPrint.cpp +++ b/xs/src/libslic3r/SLAPrint.cpp @@ -55,12 +55,11 @@ SLAPrint::slice() } // generate infill - const float infill_spacing = this->config.get_abs_value("infill_extrusion_width", this->config.layer_height.value); - if (this->config.fill_density < 100 && infill_spacing > 0) { + if (this->config.fill_density < 100) { std::auto_ptr fill(Fill::new_from_type(this->config.fill_pattern.value)); fill->bounding_box.merge(Point::new_scale(bb.min.x, bb.min.y)); fill->bounding_box.merge(Point::new_scale(bb.max.x, bb.max.y)); - fill->spacing = infill_spacing; + fill->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; @@ -156,7 +155,7 @@ SLAPrint::_infill_layer(size_t i, const Fill* _fill) Layer &layer = this->layers[i]; const float shell_thickness = this->config.get_abs_value("perimeter_extrusion_width", this->config.layer_height.value); - + // In order to detect what regions of this layer need to be solid, // perform an intersection with layers within the requested shell thickness. Polygons internal = layer.slices;