FIX: Slicer creates invalid color pattern

github: 3749
Change-Id: I3fd74a9ca59b75873fcbca4437e4858c749ee853
This commit is contained in:
zhimin.zeng 2024-03-28 14:00:37 +08:00 committed by Lane.Wei
parent 2e426c8f96
commit 92d125c41f
1 changed files with 3 additions and 1 deletions

View File

@ -1980,7 +1980,9 @@ std::vector<std::vector<ExPolygons>> multi_material_segmentation_by_painting(con
// be outside EdgeGrid's BoundingBox, for example, when the negative volume is used on the painted area (GH #7618).
// To ensure that the painted line is always inside EdgeGrid's BoundingBox, it is clipped by EdgeGrid's BoundingBox in cases
// when any of the endpoints of the line are outside the EdgeGrid's BoundingBox.
if (const BoundingBox &edge_grid_bbox = edge_grids[layer_idx].bbox(); !edge_grid_bbox.contains(line_to_test.a) || !edge_grid_bbox.contains(line_to_test.b)) {
BoundingBox edge_grid_bbox = edge_grids[layer_idx].bbox();
edge_grid_bbox.offset(10 * scale_(EPSILON));
if (!edge_grid_bbox.contains(line_to_test.a) || !edge_grid_bbox.contains(line_to_test.b)) {
// If the painted line (line_to_test) is entirely outside EdgeGrid's BoundingBox, skip this painted line.
if (!edge_grid_bbox.overlap(BoundingBox(Points{line_to_test.a, line_to_test.b})) ||
!line_to_test.clip_with_bbox(edge_grid_bbox))