ENH: improve archor of internal bridge

Add loop inside sparse infill of lower layer
to provide archor for internal bridge.

This option controls how many lower layers generate
loop path.

Signed-off-by: salt.wei <salt.wei@bambulab.com>
Change-Id: Ifdb6db9090115732aa2cacf5d155b587a10e18fc
(cherry picked from commit 4fdb87ecd5c2e680f6bad2d018ba39cd05f787ce)
This commit is contained in:
salt.wei 2022-11-15 20:20:48 +08:00 committed by Lane.Wei
parent 08494b5f6f
commit 588f18ac58
18 changed files with 141 additions and 15 deletions

View file

@ -46,6 +46,8 @@ struct SurfaceFillParams
// 1000mm is roughly the maximum length line that fits into a 32bit coord_t.
float anchor_length = 1000.f;
float anchor_length_max = 1000.f;
//BBS
bool with_loop = false;
// width, height of extrusion, nozzle diameter, is bridge
// For the output, for fill generator.
@ -77,6 +79,7 @@ struct SurfaceFillParams
// RETURN_COMPARE_NON_EQUAL_TYPED(unsigned, dont_adjust);
RETURN_COMPARE_NON_EQUAL(anchor_length);
RETURN_COMPARE_NON_EQUAL(anchor_length_max);
RETURN_COMPARE_NON_EQUAL(with_loop);
RETURN_COMPARE_NON_EQUAL(flow.width());
RETURN_COMPARE_NON_EQUAL(flow.height());
RETURN_COMPARE_NON_EQUAL(flow.nozzle_diameter());
@ -97,6 +100,7 @@ struct SurfaceFillParams
// this->dont_adjust == rhs.dont_adjust &&
this->anchor_length == rhs.anchor_length &&
this->anchor_length_max == rhs.anchor_length_max &&
this->with_loop == rhs.with_loop &&
this->flow == rhs.flow &&
this->extrusion_role == rhs.extrusion_role;
}
@ -147,6 +151,8 @@ std::vector<SurfaceFill> group_fills(const Layer &layer)
params.extruder = layerm.region().extruder(extrusion_role);
params.pattern = region_config.sparse_infill_pattern.value;
params.density = float(region_config.sparse_infill_density);
//BBS
params.with_loop = surface.surface_type == stInternalWithLoop;
if (surface.is_solid()) {
params.density = 100.f;
@ -465,6 +471,7 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive:
params.extrusion_role = surface_fill.params.extrusion_role;
params.using_internal_flow = using_internal_flow;
params.no_extrusion_overlap = surface_fill.params.overlap;
params.with_loop = surface_fill.params.with_loop;
LayerRegion* layerm = this->m_regions[surface_fill.region_id];
for (ExPolygon& expoly : surface_fill.expolygons) {