FIX: tree support's enforcers inside a hole were wrong
Previously holes of enforcer_polygons was taken as contours, which caused enforcers inside a hole were too large. Jira: STUDIO-3877 Change-Id: If38c34e2469b822012a2ed0b082783563fe99228
This commit is contained in:
parent
99406816cd
commit
a1bc4b3a57
1 changed files with 16 additions and 14 deletions
|
@ -1140,19 +1140,13 @@ void TreeSupport::detect_overhangs(bool detect_first_sharp_tail_only)
|
||||||
Polygons lower_layer_polygons = (layer_nr == 0) ? Polygons() : to_polygons(lower_layer->lslices);
|
Polygons lower_layer_polygons = (layer_nr == 0) ? Polygons() : to_polygons(lower_layer->lslices);
|
||||||
Polygons& enforcer = enforcers[layer_nr];
|
Polygons& enforcer = enforcers[layer_nr];
|
||||||
if (!enforcer.empty()) {
|
if (!enforcer.empty()) {
|
||||||
Polygons enforcer_polygons = diff(intersection(layer->lslices, enforcer),
|
ExPolygons enforcer_polygons = diff_ex(intersection_ex(layer->lslices, enforcer),
|
||||||
// Inflate just a tiny bit to avoid intersection of the overhang areas with the object.
|
// Inflate just a tiny bit to avoid intersection of the overhang areas with the object.
|
||||||
expand(lower_layer_polygons, 0.05f * no_interface_offset, SUPPORT_SURFACES_OFFSET_PARAMETERS));
|
expand(lower_layer_polygons, 0.05f * no_interface_offset, SUPPORT_SURFACES_OFFSET_PARAMETERS));
|
||||||
// coconut: enforcer can't do offset2_ex, otherwise faces with angle near 90 degrees can't have enforcers, which
|
append(ts_layer->overhang_areas, enforcer_polygons);
|
||||||
// is not good. For example: tails of animals needs extra support except the lowest tip.
|
|
||||||
//enforcer = std::move(offset2_ex(enforcer, -0.1 * extrusion_width_scaled, 0.1 * extrusion_width_scaled));
|
|
||||||
enforcer_polygons = offset(enforcer_polygons, 0.1 * extrusion_width_scaled);
|
|
||||||
for (const Polygon& poly : enforcer_polygons) {
|
|
||||||
ts_layer->overhang_areas.emplace_back(poly);
|
|
||||||
ts_layer->overhang_types.emplace(&ts_layer->overhang_areas.back(), SupportLayer::Enforced);
|
ts_layer->overhang_types.emplace(&ts_layer->overhang_areas.back(), SupportLayer::Enforced);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!ts_layer->overhang_areas.empty()) has_overhangs = true;
|
if (!ts_layer->overhang_areas.empty()) has_overhangs = true;
|
||||||
if (!layer->cantilevers.empty()) has_cantilever = true;
|
if (!layer->cantilevers.empty()) has_cantilever = true;
|
||||||
|
@ -1169,11 +1163,19 @@ void TreeSupport::detect_overhangs(bool detect_first_sharp_tail_only)
|
||||||
svg.draw(layer->overhang_areas, "orange");
|
svg.draw(layer->overhang_areas, "orange");
|
||||||
if (blockers.size() > layer->id())
|
if (blockers.size() > layer->id())
|
||||||
svg.draw(blockers[layer->id()], "red");
|
svg.draw(blockers[layer->id()], "red");
|
||||||
for (auto& overhang : layer->overhang_areas) {
|
}
|
||||||
double aarea = overhang.area()/ area_thresh_well_supported;
|
if (enforcers.size() > layer->id()) {
|
||||||
auto pt = get_extents(overhang).center();
|
SVG svg(format("SVG/enforcer_%s.svg", layer->print_z), m_object->bounding_box());
|
||||||
char x[20]; sprintf(x, "%.2f", aarea);
|
if (svg.is_opened()) {
|
||||||
svg.draw_text(pt, x, "red");
|
svg.draw_outline(m_object->get_layer(layer->id())->lslices, "yellow");
|
||||||
|
svg.draw(enforcers[layer->id()], "red");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (blockers.size() > layer->id()) {
|
||||||
|
SVG svg(format("SVG/blocker_%s.svg", layer->print_z), m_object->bounding_box());
|
||||||
|
if (svg.is_opened()) {
|
||||||
|
svg.draw_outline(m_object->get_layer(layer->id())->lslices, "yellow");
|
||||||
|
svg.draw(blockers[layer->id()], "red");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue