mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-18 19:12:17 +00:00
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:
@@ -2956,11 +2956,12 @@ void make_fill_lines(const ExPolygonWithOffset &poly_with_offset, Point refpt, d
|
||||
}
|
||||
}
|
||||
|
||||
bool FillRectilinear::fill_surface_by_multilines(const Surface *surface, FillParams params, const std::initializer_list<SweepParams> &sweep_params, Polylines &polylines_out)
|
||||
bool FillRectilinear::fill_surface_by_multilines(const Surface *surface, FillParams params, const std::initializer_list<SweepParams> &sweep_params, Polylines &polylines_out) // fill multiline
|
||||
{
|
||||
assert(sweep_params.size() >= 1);
|
||||
assert(! params.full_infill());
|
||||
assert(!params.full_infill());
|
||||
params.density /= double(sweep_params.size());
|
||||
int n_multilines = params.multiline;
|
||||
assert(params.density > 0.0001f && params.density <= 1.f);
|
||||
|
||||
ExPolygonWithOffset poly_with_offset_base(surface->expolygon, 0, float(scale_(this->overlap - 0.5 * this->spacing)));
|
||||
@@ -2970,12 +2971,21 @@ bool FillRectilinear::fill_surface_by_multilines(const Surface *surface, FillPar
|
||||
|
||||
Polylines fill_lines;
|
||||
coord_t line_width = coord_t(scale_(this->spacing));
|
||||
coord_t line_spacing = coord_t(scale_(this->spacing) / params.density);
|
||||
coord_t line_spacing = coord_t(scale_(this->spacing) * params.multiline / params.density);
|
||||
std::pair<float, Point> rotate_vector = this->_infill_direction(surface);
|
||||
for (const SweepParams &sweep : sweep_params) {
|
||||
// Rotate polygons so that we can work with vertical lines here
|
||||
float angle = rotate_vector.first + sweep.angle_base;
|
||||
make_fill_lines(ExPolygonWithOffset(poly_with_offset_base, - angle), rotate_vector.second.rotated(-angle), angle, line_width + coord_t(SCALED_EPSILON), line_spacing, coord_t(scale_(sweep.pattern_shift)), fill_lines);
|
||||
//Fill Multiline
|
||||
for (int i = 0; i < n_multilines; ++i) {
|
||||
coord_t group_offset = i * line_spacing;
|
||||
coord_t internal_offset = (i - (n_multilines - 1) / 2.0f) * line_width;
|
||||
coord_t total_offset = group_offset + internal_offset;
|
||||
coord_t pattern_shift = scale_(sweep.pattern_shift + unscale_(total_offset));
|
||||
|
||||
make_fill_lines(ExPolygonWithOffset(poly_with_offset_base, -angle), rotate_vector.second.rotated(-angle), angle,
|
||||
line_width + coord_t(SCALED_EPSILON), line_spacing, pattern_shift, fill_lines);
|
||||
}
|
||||
}
|
||||
|
||||
if (!fill_lines.empty()) {
|
||||
@@ -3057,8 +3067,7 @@ Polylines Fill2DLattice::fill_surface(const Surface *surface, const FillParams &
|
||||
return polylines_out;
|
||||
}
|
||||
|
||||
Polylines FillTriangles::fill_surface(const Surface *surface, const FillParams ¶ms)
|
||||
{
|
||||
Polylines FillTriangles::fill_surface(const Surface *surface, const FillParams ¶ms){
|
||||
Polylines polylines_out;
|
||||
if (! this->fill_surface_by_multilines(
|
||||
surface, params,
|
||||
@@ -3073,7 +3082,7 @@ Polylines FillStars::fill_surface(const Surface *surface, const FillParams ¶
|
||||
Polylines polylines_out;
|
||||
if (! this->fill_surface_by_multilines(
|
||||
surface, params,
|
||||
{ { 0.f, 0.f }, { float(M_PI / 3.), 0.f }, { float(2. * M_PI / 3.), float((3./2.) * this->spacing / params.density) } },
|
||||
{ { 0.f, 0.f }, { float(M_PI / 3.), 0.f }, { float(2. * M_PI / 3.), float((3./2.) * this->spacing * params.multiline / params.density) } },
|
||||
polylines_out))
|
||||
BOOST_LOG_TRIVIAL(error) << "FillStars::fill_surface() failed to fill a region.";
|
||||
return polylines_out;
|
||||
@@ -3094,7 +3103,6 @@ Polylines FillCubic::fill_surface(const Surface *surface, const FillParams ¶
|
||||
Polylines FillQuarterCubic::fill_surface(const Surface* surface, const FillParams& params)
|
||||
{
|
||||
using namespace boost::math::float_constants;
|
||||
|
||||
Polylines polylines_out;
|
||||
|
||||
coord_t line_width = coord_t(scale_(this->spacing));
|
||||
|
||||
Reference in New Issue
Block a user