mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-28 05:12:27 +00:00
Adjusted density multiline infill for adaptive cubic, support cubic, lightning patterns (prevent crash) and minor GUI correction. (#10967)
* FillAdaptive density adjusted * Fill lightning multiline density adjust * Gui corrections by IanAlexis
This commit is contained in:
@@ -349,8 +349,9 @@ std::pair<double, double> adaptive_fill_line_spacing(const PrintObject &print_ob
|
||||
} else
|
||||
return 0.;
|
||||
};
|
||||
adaptive_line_spacing = to_line_spacing(adaptive_cnt, adaptive_fill_density, adaptive_infill_extrusion_width);
|
||||
support_line_spacing = to_line_spacing(support_cnt, support_fill_density, support_infill_extrusion_width);
|
||||
const int n_multiline = print_object.printing_region(0).config().fill_multiline.value;
|
||||
adaptive_line_spacing = to_line_spacing(adaptive_cnt, adaptive_fill_density, adaptive_infill_extrusion_width) * n_multiline;
|
||||
support_line_spacing = to_line_spacing(support_cnt, support_fill_density, support_infill_extrusion_width) * n_multiline;
|
||||
}
|
||||
|
||||
return std::make_pair(adaptive_line_spacing, support_line_spacing);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "../ClipperUtils.hpp"
|
||||
#include "../Print.hpp"
|
||||
#include "../ShortestPath.hpp"
|
||||
#include "FillBase.hpp"
|
||||
@@ -19,6 +20,7 @@ void Filler::_fill_surface_single(
|
||||
// Apply multiline offset if needed
|
||||
multiline_fill(fill_lines, params, spacing);
|
||||
|
||||
fill_lines = Slic3r::intersection_pl(std::move(fill_lines), expolygon);
|
||||
|
||||
chain_or_connect_infill(std::move(fill_lines), expolygon, polylines_out, this->spacing, params);
|
||||
}
|
||||
|
||||
@@ -2998,7 +2998,6 @@ bool FillRectilinear::fill_surface_by_multilines(const Surface *surface, FillPar
|
||||
assert(sweep_params.size() >= 1);
|
||||
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)));
|
||||
@@ -3014,9 +3013,9 @@ bool FillRectilinear::fill_surface_by_multilines(const Surface *surface, FillPar
|
||||
// Rotate polygons so that we can work with vertical lines here
|
||||
float angle = rotate_vector.first + sweep.angle_base;
|
||||
//Fill Multiline
|
||||
for (int i = 0; i < n_multilines; ++i) {
|
||||
for (int i = 0; i < params.multiline; ++i) {
|
||||
coord_t group_offset = i * line_spacing;
|
||||
coord_t internal_offset = (i - (n_multilines - 1) / 2.0f) * line_width;
|
||||
coord_t internal_offset = (i - (params.multiline - 1) / 2.0f) * line_width;
|
||||
coord_t total_offset = group_offset + internal_offset;
|
||||
coord_t pattern_shift = scale_(sweep.pattern_shift + unscale_(total_offset));
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ Generator::Generator(const PrintObject &print_object, const std::function<void()
|
||||
const PrintRegionConfig ®ion_config = print_object.shared_regions()->all_regions.front()->config();
|
||||
const std::vector<double> &nozzle_diameters = print_config.nozzle_diameter.values;
|
||||
double max_nozzle_diameter = *std::max_element(nozzle_diameters.begin(), nozzle_diameters.end());
|
||||
const int n_multiline = region_config.fill_multiline.value;
|
||||
// const int infill_extruder = region_config.infill_extruder.value;
|
||||
const double default_infill_extrusion_width = Flow::auto_extrusion_width(FlowRole::frInfill, float(max_nozzle_diameter));
|
||||
// Note: There's not going to be a layer below the first one, so the 'initial layer height' doesn't have to be taken into account.
|
||||
@@ -86,7 +87,7 @@ Generator::Generator(const PrintObject &print_object, const std::function<void()
|
||||
object_config.line_width.get_abs_value(max_nozzle_diameter)
|
||||
);
|
||||
|
||||
m_supporting_radius = coord_t(m_infill_extrusion_width) * 100 / region_config.sparse_infill_density;
|
||||
m_supporting_radius = coord_t(m_infill_extrusion_width) * 100 * n_multiline / region_config.sparse_infill_density;
|
||||
|
||||
const double lightning_infill_overhang_angle = M_PI / 4; // 45 degrees
|
||||
const double lightning_infill_prune_angle = M_PI / 4; // 45 degrees
|
||||
|
||||
Reference in New Issue
Block a user