FIX: Top surface bridging fail on 3DHC & FL infill
Add 45 degree angle offset when processing the bridge. Need to raise infill_direction to invalidate posPrepareInfill jira: 6774 Change-Id: I5e6bef3aa814b01c5f30398ac745937a67e3ef4c (cherry picked from commit 7b12cab10b88f432a11414f8caa1c6427777a1ba)
This commit is contained in:
parent
c5d9b3a3a7
commit
427deda14e
|
@ -196,7 +196,7 @@ void Fill3DHoneycomb::_fill_surface_single(
|
||||||
{
|
{
|
||||||
// no rotation is supported for this infill pattern
|
// no rotation is supported for this infill pattern
|
||||||
// BBL: add support for rotation
|
// BBL: add support for rotation
|
||||||
auto infill_angle = float(this->angle);
|
auto infill_angle = float(this->angle);
|
||||||
if (std::abs(infill_angle) >= EPSILON) expolygon.rotate(-infill_angle);
|
if (std::abs(infill_angle) >= EPSILON) expolygon.rotate(-infill_angle);
|
||||||
BoundingBox bb = expolygon.contour.bounding_box();
|
BoundingBox bb = expolygon.contour.bounding_box();
|
||||||
|
|
||||||
|
|
|
@ -196,7 +196,7 @@ void FillFlippingLine ::_fill_surface_single(
|
||||||
coord_t line_spacing = coord_t(scale_(this->spacing) / params.density);
|
coord_t line_spacing = coord_t(scale_(this->spacing) / params.density);
|
||||||
|
|
||||||
// reduce density
|
// reduce density
|
||||||
if (params.density < 0.999) line_spacing *= 1.5;
|
if (params.density < 0.999) line_spacing *= 1.08;
|
||||||
|
|
||||||
bb.merge(align_to_grid(bb.min, Point(line_spacing * 4, line_spacing * 4)));
|
bb.merge(align_to_grid(bb.min, Point(line_spacing * 4, line_spacing * 4)));
|
||||||
|
|
||||||
|
|
|
@ -2211,9 +2211,17 @@ void PrintObject::bridge_over_infill()
|
||||||
};
|
};
|
||||||
|
|
||||||
// LAMBDA do determine optimal bridging angle
|
// LAMBDA do determine optimal bridging angle
|
||||||
auto determine_bridging_angle = [](const Polygons &bridged_area, const Lines &anchors, InfillPattern dominant_pattern) {
|
auto determine_bridging_angle = [](const Polygons &bridged_area, const Lines &anchors, InfillPattern dominant_pattern, double infill_direction) {
|
||||||
AABBTreeLines::LinesDistancer<Line> lines_tree(anchors);
|
AABBTreeLines::LinesDistancer<Line> lines_tree(anchors);
|
||||||
|
|
||||||
|
// Check it the infill that require a fixed infill angle.
|
||||||
|
switch (dominant_pattern) {
|
||||||
|
case ip3DHoneycomb:
|
||||||
|
case ipFlippingLine:
|
||||||
|
return (infill_direction + 45.0) * 2.0 * M_PI / 360.;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
std::map<double, int> counted_directions;
|
std::map<double, int> counted_directions;
|
||||||
for (const Polygon &p : bridged_area) {
|
for (const Polygon &p : bridged_area) {
|
||||||
double acc_distance = 0;
|
double acc_distance = 0;
|
||||||
|
@ -2587,11 +2595,12 @@ void PrintObject::bridge_over_infill()
|
||||||
double bridging_angle = 0;
|
double bridging_angle = 0;
|
||||||
if (!anchors.empty()) {
|
if (!anchors.empty()) {
|
||||||
bridging_angle = determine_bridging_angle(area_to_be_bridge, to_lines(anchors),
|
bridging_angle = determine_bridging_angle(area_to_be_bridge, to_lines(anchors),
|
||||||
candidate.region->region().config().sparse_infill_pattern.value);
|
candidate.region->region().config().sparse_infill_pattern.value,
|
||||||
|
candidate.region->region().config().infill_direction.value);
|
||||||
} else {
|
} else {
|
||||||
// use expansion boundaries as anchors.
|
// use expansion boundaries as anchors.
|
||||||
// Also, use Infill pattern that is neutral for angle determination, since there are no infill lines.
|
// Also, use Infill pattern that is neutral for angle determination, since there are no infill lines.
|
||||||
bridging_angle = determine_bridging_angle(area_to_be_bridge, to_lines(boundary_plines), InfillPattern::ipLine);
|
bridging_angle = determine_bridging_angle(area_to_be_bridge, to_lines(boundary_plines), InfillPattern::ipLine, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
boundary_plines.insert(boundary_plines.end(), anchors.begin(), anchors.end());
|
boundary_plines.insert(boundary_plines.end(), anchors.begin(), anchors.end());
|
||||||
|
|
Loading…
Reference in New Issue