Infill Line Multiplier (#9432)

* Infill Line Multiplier

* Modular Offset Function

* Lightning multiline

* Crosshatch Multiline

ipCrosshatch

* cleaning

Cleaning

clean2

* 3d Honeycomb

cut poliline ends

* Fill Tpmsd Multiline

Fill Tpmsd Multiline

* Update Multiline function

multiline funcion simplify

* Update FillTpmsD

* FillHoneycomb

* Update src/libslic3r/PrintConfig.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix Honeycomb Multiline

Simplify polylines in honeycomb infill generation

* Improve multiline infill support and pattern simplification

Moved multiline infill application after pattern translation and simplification in Fill3DHoneycomb, and added multiline support to FillAdaptive. Updated honeycomb and 3D honeycomb infill to simplify polylines to 5x line width. Extended GUI and config to support multiline for Adaptive Cubic infill pattern and clarified max value comment.

minimum changes

Co-Authored-By: Ian Bassi <12130714+ianalexis@users.noreply.github.com>

* Increase multiline fill spacing in honeycomb infill

Adjusts the spacing parameter in the multiline_fill function to 1.1 times the original spacing, potentially improving infill distribution or print quality.

* Refine fill_multiline tooltip and pattern support logic

Updated the tooltip for the 'fill_multiline' parameter to improve clarity and punctuation. Refactored the logic in ConfigManipulation.cpp to clarify which infill patterns support multiline infill.

* better management of non supported infill patterns

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
Co-authored-by: Ian Bassi <12130714+ianalexis@users.noreply.github.com>
This commit is contained in:
Rodrigo
2025-06-30 12:07:33 -03:00
committed by GitHub
parent 10687085ee
commit a8141ef360
17 changed files with 164 additions and 37 deletions

View File

@@ -1,7 +1,7 @@
#include "../ClipperUtils.hpp"
#include "../ShortestPath.hpp"
#include "../Surface.hpp"
#include "FillBase.hpp"
#include "Fill3DHoneycomb.hpp"
namespace Slic3r {
@@ -212,7 +212,7 @@ void Fill3DHoneycomb::_fill_surface_single(
// = 4 * integrate(func=4*x(sqrt(2) - 1) + 1, from=0, to=0.25)
// = (sqrt(2) + 1) / 2 [... I think]
// make a first guess at the preferred grid Size
coordf_t gridSize = (scale_(this->spacing) * ((zScale + 1.) / 2.) / params.density);
coordf_t gridSize = (scale_(this->spacing) * ((zScale + 1.) / 2.) * params.multiline / params.density);
// This density calculation is incorrect for many values > 25%, possibly
// due to quantisation error, so this value is used as a first guess, then the
@@ -228,7 +228,7 @@ void Fill3DHoneycomb::_fill_surface_single(
layersPerModule = 2;
// re-adjust the grid size for a partial octahedral path
// (scale of 1.1 guessed based on modeling)
gridSize = (scale_(this->spacing) * 1.1 / params.density);
gridSize = (scale_(this->spacing) * 1.1 * params.multiline / params.density);
// re-adjust zScale to make layering consistent
zScale = (gridSize * 2) / (layersPerModule * layerHeight);
} else {
@@ -238,7 +238,7 @@ void Fill3DHoneycomb::_fill_surface_single(
// re-adjust zScale to make layering consistent
zScale = (gridSize * 2) / (layersPerModule * layerHeight);
// re-adjust the grid size to account for the new zScale
gridSize = (scale_(this->spacing) * ((zScale + 1.) / 2.) / params.density);
gridSize = (scale_(this->spacing) * ((zScale + 1.) / 2.) * params.multiline / params.density);
// re-calculate layersPerModule and zScale
layersPerModule = floor((gridSize * 2) / (zScale * layerHeight) + 0.05);
if(layersPerModule < 2){
@@ -264,11 +264,24 @@ void Fill3DHoneycomb::_fill_surface_single(
// move pattern in place
for (Polyline &pl : polylines){
pl.translate(bb.min);
pl.simplify(5 * spacing); // simplify to 5x line width
}
// Apply multiline offset if needed
multiline_fill(polylines, params, spacing);
// clip pattern to boundaries, chain the clipped polylines
polylines = intersection_pl(polylines, to_polygons(expolygon));
if (! polylines.empty()) {
// Remove very small bits, but be careful to not remove infill lines connecting thin walls!
// The infill perimeter lines should be separated by around a single infill line width.
const double minlength = scale_(0.8 * this->spacing);
polylines.erase(
std::remove_if(polylines.begin(), polylines.end(), [minlength](const Polyline &pl) { return pl.length() < minlength; }),
polylines.end());
}
// copy from fliplines
if (!polylines.empty()) {
int infill_start_idx = polylines_out.size(); // only rotate what belongs to us.