mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 04:25:55 +08:00
fix gapfill:
* fix gapfill after external perimeter: Happens if external perimeter has a different width than internal. supermerill/SuperSlicer#1640 * revert 3b0c006 : not needed anymore. if ever needed again, I added a [size > 1] to fix the problem supermerill/SuperSlicer#1758
This commit is contained in:
parent
caa27d3598
commit
57c82dbe72
@ -1727,12 +1727,13 @@ MedialAxis::build(ThickPolylines &polylines_out)
|
|||||||
tp.width[i] = this->max_width;
|
tp.width[i] = this->max_width;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// voronoi bugfix: when we have a wheel, it creates a polyline at the center, completly out of the polygon.
|
// voronoi bugfix: when we have a wheel, it creates a polyline at the center, completly out of the polygon. #651
|
||||||
if (tp.endpoints.first && tp.endpoints.second && !this->expolygon.contains(tp.first_point()) && !this->expolygon.contains(tp.last_point())) {
|
// note: can't reproduce in the new verison. This may have been fixed by another way.
|
||||||
//delete this out-of-bounds polyline
|
//if (tp.endpoints.first && tp.endpoints.second && !this->expolygon.contains(tp.first_point()) && !this->expolygon.contains(tp.last_point()) && pp.size() > 1) {
|
||||||
pp.erase(pp.begin() + tp_idx);
|
// //delete this out-of-bounds polyline
|
||||||
--tp_idx;
|
// pp.erase(pp.begin() + tp_idx);
|
||||||
}
|
// --tp_idx;
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
//std::cout << "polyline_from_voronoi\n";
|
//std::cout << "polyline_from_voronoi\n";
|
||||||
//{
|
//{
|
||||||
|
@ -43,15 +43,15 @@ void PerimeterGenerator::process()
|
|||||||
|
|
||||||
// other perimeters
|
// other perimeters
|
||||||
this->_mm3_per_mm = this->perimeter_flow.mm3_per_mm();
|
this->_mm3_per_mm = this->perimeter_flow.mm3_per_mm();
|
||||||
coord_t perimeter_width = this->perimeter_flow.scaled_width();
|
const coord_t perimeter_width = this->perimeter_flow.scaled_width();
|
||||||
//spacing between internal perimeters
|
//spacing between internal perimeters
|
||||||
coord_t perimeter_spacing = this->perimeter_flow.scaled_spacing();
|
const coord_t perimeter_spacing = this->perimeter_flow.scaled_spacing();
|
||||||
|
|
||||||
// external perimeters
|
// external perimeters
|
||||||
this->_ext_mm3_per_mm = this->ext_perimeter_flow.mm3_per_mm();
|
this->_ext_mm3_per_mm = this->ext_perimeter_flow.mm3_per_mm();
|
||||||
coord_t ext_perimeter_width = this->ext_perimeter_flow.scaled_width();
|
const coord_t ext_perimeter_width = this->ext_perimeter_flow.scaled_width();
|
||||||
//spacing between two external perimeter (where you don't have the space to add other loops)
|
//spacing between two external perimeter (where you don't have the space to add other loops)
|
||||||
coord_t ext_perimeter_spacing = this->ext_perimeter_flow.scaled_spacing();
|
const coord_t ext_perimeter_spacing = this->ext_perimeter_flow.scaled_spacing();
|
||||||
//spacing between external perimeter and the second
|
//spacing between external perimeter and the second
|
||||||
coord_t ext_perimeter_spacing2 = this->ext_perimeter_flow.scaled_spacing(this->perimeter_flow);
|
coord_t ext_perimeter_spacing2 = this->ext_perimeter_flow.scaled_spacing(this->perimeter_flow);
|
||||||
|
|
||||||
@ -59,19 +59,21 @@ void PerimeterGenerator::process()
|
|||||||
this->_mm3_per_mm_overhang = this->overhang_flow.mm3_per_mm();
|
this->_mm3_per_mm_overhang = this->overhang_flow.mm3_per_mm();
|
||||||
|
|
||||||
//gap fill
|
//gap fill
|
||||||
coord_t gap_fill_spacing = this->config->gap_fill_overlap.get_abs_value(this->perimeter_flow.scaled_spacing())
|
const coord_t gap_fill_spacing_external = this->config->gap_fill_overlap.get_abs_value(this->ext_perimeter_flow.scaled_spacing())
|
||||||
+ this->perimeter_flow.scaled_width() * (100 - this->config->gap_fill_overlap.value) / 100.;
|
+ this->ext_perimeter_flow.scaled_width() * (1 - this->config->gap_fill_overlap.get_abs_value(1.));
|
||||||
|
const coord_t gap_fill_spacing = this->config->gap_fill_overlap.get_abs_value(this->perimeter_flow.scaled_spacing())
|
||||||
|
+ this->perimeter_flow.scaled_width() * (1 - this->config->gap_fill_overlap.get_abs_value(1.));
|
||||||
|
|
||||||
// solid infill
|
// solid infill
|
||||||
coord_t solid_infill_spacing = this->solid_infill_flow.scaled_spacing();
|
const coord_t solid_infill_spacing = this->solid_infill_flow.scaled_spacing();
|
||||||
|
|
||||||
//infill / perimeter
|
//infill / perimeter
|
||||||
coord_t infill_peri_overlap = (coord_t)scale_(this->config->get_abs_value("infill_overlap", unscale<coordf_t>(perimeter_spacing + solid_infill_spacing) / 2));
|
coord_t infill_peri_overlap = (coord_t)scale_(this->config->get_abs_value("infill_overlap", unscale<coordf_t>(perimeter_spacing + solid_infill_spacing) / 2));
|
||||||
// infill gap to add vs perimeter (useful if using perimeter bonding)
|
// infill gap to add vs perimeter (useful if using perimeter bonding)
|
||||||
coord_t infill_gap = 0;
|
coord_t infill_gap = 0;
|
||||||
|
|
||||||
bool round_peri = this->config->perimeter_round_corners.value;
|
const bool round_peri = this->config->perimeter_round_corners.value;
|
||||||
coord_t min_round_spacing = perimeter_width / 10;
|
const coord_t min_round_spacing = perimeter_width / 10;
|
||||||
|
|
||||||
// nozzle diameter
|
// nozzle diameter
|
||||||
const double nozzle_diameter = this->print_config->nozzle_diameter.get_at(this->config->perimeter_extruder - 1);
|
const double nozzle_diameter = this->print_config->nozzle_diameter.get_at(this->config->perimeter_extruder - 1);
|
||||||
@ -95,8 +97,8 @@ void PerimeterGenerator::process()
|
|||||||
// which is the spacing between external and internal, which is not correct
|
// which is the spacing between external and internal, which is not correct
|
||||||
// and would make the collapsing (thus the details resolution) dependent on
|
// and would make the collapsing (thus the details resolution) dependent on
|
||||||
// internal flow which is unrelated. <- i don't undertand, so revert to ext_perimeter_spacing2
|
// internal flow which is unrelated. <- i don't undertand, so revert to ext_perimeter_spacing2
|
||||||
coord_t min_spacing = (coord_t)( perimeter_spacing * (1 - 0.05/*INSET_OVERLAP_TOLERANCE*/) );
|
const coord_t min_spacing = (coord_t)( perimeter_spacing * (1 - 0.05/*INSET_OVERLAP_TOLERANCE*/) );
|
||||||
coord_t ext_min_spacing = (coord_t)( ext_perimeter_spacing2 * (1 - 0.05/*INSET_OVERLAP_TOLERANCE*/) );
|
const coord_t ext_min_spacing = (coord_t)( ext_perimeter_spacing2 * (1 - 0.05/*INSET_OVERLAP_TOLERANCE*/) );
|
||||||
|
|
||||||
// prepare grown lower layer slices for overhang detection
|
// prepare grown lower layer slices for overhang detection
|
||||||
if (this->lower_slices != NULL && (this->config->overhangs_width.value > 0 || this->config->overhangs_width_speed.value > 0)) {
|
if (this->lower_slices != NULL && (this->config->overhangs_width.value > 0 || this->config->overhangs_width_speed.value > 0)) {
|
||||||
@ -651,11 +653,17 @@ void PerimeterGenerator::process()
|
|||||||
no_last_gapfill = offset_ex(next_onion, 0.5f * good_spacing + 10,
|
no_last_gapfill = offset_ex(next_onion, 0.5f * good_spacing + 10,
|
||||||
(round_peri ? ClipperLib::JoinType::jtRound : ClipperLib::JoinType::jtMiter),
|
(round_peri ? ClipperLib::JoinType::jtRound : ClipperLib::JoinType::jtMiter),
|
||||||
(round_peri ? min_round_spacing : 3));
|
(round_peri ? min_round_spacing : 3));
|
||||||
|
if (i == 1) {
|
||||||
|
append(gaps, diff_ex(
|
||||||
|
offset_ex(last, -0.5f * gap_fill_spacing_external),
|
||||||
|
no_last_gapfill)); // safety offset
|
||||||
|
} else {
|
||||||
append(gaps, diff_ex(
|
append(gaps, diff_ex(
|
||||||
offset_ex(last, -0.5f * gap_fill_spacing),
|
offset_ex(last, -0.5f * gap_fill_spacing),
|
||||||
no_last_gapfill)); // safety offset
|
no_last_gapfill)); // safety offset
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (next_onion.empty()) {
|
if (next_onion.empty()) {
|
||||||
// Store the number of loops actually generated.
|
// Store the number of loops actually generated.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user