FIX: support blockers in tree support not working after mirroring
This is caused by the inverse-order polgyons after mirroring. Adding a union_ before offset_ex fixes this bug. Github: #1621 Jira: 2738 Change-Id: I885a3ca6af4e5fadb2158d913cf67525bfffa91e (cherry picked from commit 4ea95d89e7ec058ac21218e1839cfe16b486893a)
This commit is contained in:
parent
751f318675
commit
e7a21ce0e1
1 changed files with 6 additions and 3 deletions
|
@ -1106,7 +1106,9 @@ void TreeSupport::detect_overhangs(bool detect_first_sharp_tail_only)
|
||||||
|
|
||||||
if (layer_nr < blockers.size()) {
|
if (layer_nr < blockers.size()) {
|
||||||
Polygons& blocker = blockers[layer_nr];
|
Polygons& blocker = blockers[layer_nr];
|
||||||
ts_layer->overhang_areas = diff_ex(ts_layer->overhang_areas, offset_ex(blocker, scale_(radius_sample_resolution)));
|
// Arthur: union_ is a must because after mirroring, the blocker polygons are in left-hand coordinates, ie clockwise,
|
||||||
|
// which are not valid polygons, and will be removed by offset_ex. union_ can make these polygons right.
|
||||||
|
ts_layer->overhang_areas = diff_ex(ts_layer->overhang_areas, offset_ex(union_(blocker), scale_(radius_sample_resolution)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (max_bridge_length > 0 && ts_layer->overhang_areas.size() > 0 && lower_layer) {
|
if (max_bridge_length > 0 && ts_layer->overhang_areas.size() > 0 && lower_layer) {
|
||||||
|
@ -1137,13 +1139,14 @@ void TreeSupport::detect_overhangs(bool detect_first_sharp_tail_only)
|
||||||
|
|
||||||
#ifdef SUPPORT_TREE_DEBUG_TO_SVG
|
#ifdef SUPPORT_TREE_DEBUG_TO_SVG
|
||||||
for (const SupportLayer* layer : m_object->support_layers()) {
|
for (const SupportLayer* layer : m_object->support_layers()) {
|
||||||
if (layer->overhang_areas.empty())
|
if (layer->overhang_areas.empty() && blockers[layer->id()].empty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SVG svg(format("SVG/overhang_areas_%s.svg", layer->print_z), m_object->bounding_box());
|
SVG svg(format("SVG/overhang_areas_%s.svg", layer->print_z), m_object->bounding_box());
|
||||||
if (svg.is_opened()) {
|
if (svg.is_opened()) {
|
||||||
svg.draw_outline(m_object->get_layer(layer->id())->lslices, "yellow");
|
svg.draw_outline(m_object->get_layer(layer->id())->lslices, "yellow");
|
||||||
svg.draw(layer->overhang_areas, "red");
|
svg.draw(layer->overhang_areas, "orange");
|
||||||
|
svg.draw(blockers[layer->id()], "red");
|
||||||
for (auto& overhang : layer->overhang_areas) {
|
for (auto& overhang : layer->overhang_areas) {
|
||||||
double aarea = overhang.area()/ area_thresh_well_supported;
|
double aarea = overhang.area()/ area_thresh_well_supported;
|
||||||
auto pt = get_extents(overhang).center();
|
auto pt = get_extents(overhang).center();
|
||||||
|
|
Loading…
Reference in a new issue