SLAPrintConfig needs other defaults

This commit is contained in:
Alessandro Ranellucci 2016-12-01 17:30:06 +01:00
parent eb86fb6c65
commit 6a1a3fc94c
2 changed files with 11 additions and 4 deletions

View File

@ -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) {

View File

@ -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(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;