Hotfix: Set minimum spacing to 0.3 if the provided configuration option is 0.

Avoids a crash with infill density < 100% on SLA prints.
This commit is contained in:
Joseph Lenox 2018-02-24 20:24:23 -06:00
parent 2d9580edb4
commit d3a3d6d620

View File

@ -54,13 +54,14 @@ SLAPrint::slice()
for (size_t i = 0; i < slices.size(); ++i) for (size_t i = 0; i < slices.size(); ++i)
this->layers[i].slices.expolygons = slices[i]; this->layers[i].slices.expolygons = slices[i];
} }
this->config.get_abs_value("infill_extrusion_width", this->config.layer_height.value);
// generate infill // generate infill
if (this->config.fill_density < 100) { if (this->config.fill_density < 100) {
std::unique_ptr<Fill> fill(Fill::new_from_type(this->config.fill_pattern.value)); std::unique_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.min.x, bb.min.y));
fill->bounding_box.merge(Point::new_scale(bb.max.x, bb.max.y)); fill->bounding_box.merge(Point::new_scale(bb.max.x, bb.max.y));
fill->min_spacing = this->config.get_abs_value("infill_extrusion_width", this->config.layer_height.value); fill->min_spacing = ( this->config.get_abs_value("infill_extrusion_width", this->config.layer_height.value) > 0 ? this->config.get_abs_value("infill_extrusion_width", this->config.layer_height.value) : 0.3);
fill->angle = Geometry::deg2rad(this->config.fill_angle.value); fill->angle = Geometry::deg2rad(this->config.fill_angle.value);
fill->density = this->config.fill_density.value/100; fill->density = this->config.fill_density.value/100;