FIX: tree support may crash for faulty models

Root cause: overhang offset may be empty
Jira: STUDIO-1197

Change-Id: If472be8ed6d209366f118f1f0e5e14b41ce26b3c
(cherry picked from commit 663e7f29f01395bf335b6bccc91f192b64be69ae)
This commit is contained in:
Arthur 2022-11-03 14:21:05 +08:00 committed by Lane.Wei
parent 6edafa8502
commit 4b7ad20159
1 changed files with 3 additions and 1 deletions

View File

@ -2055,7 +2055,9 @@ void TreeSupport::draw_circles(const std::vector<std::vector<Node*>>& contact_no
ExPolygon area;
// 如果是混合支撑里的普通部分或没有启用顶部接触层则直接从overhang多边形生成
if (node.type == ePolygon || (top_interface_layers>0 &&node.support_roof_layers_below > 0)) {
area = offset_ex({ *node.overhang }, scale_(m_ts_data->m_xy_distance))[0];
auto tmp = offset_ex({ *node.overhang }, scale_(m_ts_data->m_xy_distance));
if(!tmp.empty()) // 对于有缺陷的模型overhang膨胀以后可能是空的
area = tmp[0];
}
else {
Polygon circle;