Corrected brim generation (width), enabling continuity with skirt

This commit is contained in:
Lukas Matena 2018-05-18 12:19:54 +02:00
parent 3f08ef70f1
commit 99293011e6

View file

@ -923,13 +923,15 @@ void Print::_make_skirt()
// Initial offset of the brim inner edge from the object (possible with a support & raft). // Initial offset of the brim inner edge from the object (possible with a support & raft).
// The skirt will touch the brim if the brim is extruded. // The skirt will touch the brim if the brim is extruded.
coord_t distance = scale_(std::max(this->config.skirt_distance.value, this->config.brim_width.value)); Flow brim_flow = this->brim_flow();
double actual_brim_width = brim_flow.spacing() * floor(this->config.brim_width.value / brim_flow.spacing());
coord_t distance = scale_(std::max(this->config.skirt_distance.value, actual_brim_width));
// Draw outlines from outside to inside. // Draw outlines from outside to inside.
// Loop while we have less skirts than required or any extruder hasn't reached the min length if any. // Loop while we have less skirts than required or any extruder hasn't reached the min length if any.
std::vector<coordf_t> extruded_length(extruders.size(), 0.); std::vector<coordf_t> extruded_length(extruders.size(), 0.);
for (int i = n_skirts, extruder_idx = 0; i > 0; -- i) { for (int i = n_skirts, extruder_idx = 0; i > 0; -- i) {
// Offset the skirt outside. // Offset the skirt outside.
distance += coord_t(scale_(spacing)); distance += coord_t(scale_(spacing/2.));
// Generate the skirt centerline. // Generate the skirt centerline.
Polygon loop; Polygon loop;
{ {
@ -989,7 +991,7 @@ void Print::_make_brim()
} }
} }
Polygons loops; Polygons loops;
size_t num_loops = size_t(floor(this->config.brim_width.value / flow.width)); size_t num_loops = size_t(floor(this->config.brim_width.value / flow.spacing()));
for (size_t i = 0; i < num_loops; ++ i) { for (size_t i = 0; i < num_loops; ++ i) {
islands = offset(islands, float(flow.scaled_spacing()), jtSquare); islands = offset(islands, float(flow.scaled_spacing()), jtSquare);
for (Polygon &poly : islands) { for (Polygon &poly : islands) {