fix thin wall: max was not high enough.

This commit is contained in:
supermerill 2020-01-14 17:11:06 +01:00
parent aa854a5c99
commit e471ce1239
2 changed files with 5 additions and 4 deletions

View File

@ -284,8 +284,8 @@ MedialAxis::validate_edge(const VD::edge_type* edge)
// return false; // return false;
// //
//shouldn't occur if perimeter_generator is well made //shouldn't occur if perimeter_generator is well made. *1.05 for a little wiggle room
if (w0 > this->max_width && w1 > this->max_width) if (w0 > this->max_width*1.05 && w1 > this->max_width*1.05)
return false; return false;
this->thickness[edge] = std::make_pair(w0, w1); this->thickness[edge] = std::make_pair(w0, w1);
@ -926,6 +926,7 @@ MedialAxis::main_fusion(ThickPolylines& pp)
if (dot_candidate_branch_test < 0) dot_candidate_branch_test = 0; if (dot_candidate_branch_test < 0) dot_candidate_branch_test = 0;
if (pp[biggest_main_branch_id].width.back()>0) if (pp[biggest_main_branch_id].width.back()>0)
test_dot += 2 * (float)dot_poly_branch; test_dot += 2 * (float)dot_poly_branch;
//std::cout << "compute dot "<< dot_poly_branch_test<<" & "<< dot_candidate_branch_test <<"\n";
} }
//test if it's useful to merge or not //test if it's useful to merge or not
//ie, don't merge 'T' but ok for 'Y', merge only lines of not disproportionate different length (ratio max: 4) (or they are both with 0-width end) //ie, don't merge 'T' but ok for 'Y', merge only lines of not disproportionate different length (ratio max: 4) (or they are both with 0-width end)
@ -953,7 +954,7 @@ MedialAxis::main_fusion(ThickPolylines& pp)
} }
if (best_candidate != nullptr) { if (best_candidate != nullptr) {
//idf++; //idf++;
//std::cout << " == fusion " << id <<" : "<< idf << " ==\n"; //std::cout << " == fusion " << id <<" : "<< idf << " == with "<< i <<" & "<<best_idx<<"\n";
// delete very near points // delete very near points
remove_point_too_near(&polyline); remove_point_too_near(&polyline);
remove_point_too_near(best_candidate); remove_point_too_near(best_candidate);

View File

@ -418,7 +418,7 @@ void PerimeterGenerator::process()
if (thin[0].area() > min_width*(ext_perimeter_width + ext_perimeter_spacing2)) { if (thin[0].area() > min_width*(ext_perimeter_width + ext_perimeter_spacing2)) {
bound.remove_point_too_near((coord_t)SCALED_RESOLUTION); bound.remove_point_too_near((coord_t)SCALED_RESOLUTION);
// the maximum thickness of our thin wall area is equal to the minimum thickness of a single loop // the maximum thickness of our thin wall area is equal to the minimum thickness of a single loop
Slic3r::MedialAxis ma{ thin[0], ext_perimeter_width + ext_perimeter_spacing2, Slic3r::MedialAxis ma{ thin[0], (coord_t)((ext_perimeter_width + ext_perimeter_spacing2)*1.1),
min_width, coord_t(this->layer_height) }; min_width, coord_t(this->layer_height) };
ma.use_bounds(bound) ma.use_bounds(bound)
.use_min_real_width((coord_t)scale_(this->ext_perimeter_flow.nozzle_diameter)) .use_min_real_width((coord_t)scale_(this->ext_perimeter_flow.nozzle_diameter))