ENH: improve smoothness of tree supports

1. Instead of smoothing top-down, now we smooth tree branches bottom-up, and do not stop at merged nodes.
2. Fix a bug where some nodes don't have child. This is critical for bottom-up smoothing.

Change-Id: Iac0fecd81dac541ca390bcf5cbdfe7fd66cfd3a2
(cherry picked from commit 536a8a4f0ef76fa0358f4b4b181c4c7e7fff8bc7)
This commit is contained in:
Arthur 2023-04-13 20:38:41 +08:00 committed by Lane.Wei
parent 763cf8ebfc
commit 719f273fa2
2 changed files with 69 additions and 34 deletions

View file

@ -259,6 +259,8 @@ public:
if (dist_mm_to_top==0)
dist_mm_to_top = parent->dist_mm_to_top + parent->height;
parent->child = this;
for (auto& neighbor : parent->merged_neighbours)
neighbor->child = this;
}
}
@ -280,15 +282,15 @@ public:
/*!
* \brief The position of this node on the layer.
*/
Point position;
Point movement; // movement towards neighbor center or outline
mutable double radius = 0.0;
mutable double max_move_dist = 0.0;
NodeType type = eCircle;
bool is_merged = false; // this node is generated by merging upper nodes
Point position;
Point movement; // movement towards neighbor center or outline
mutable double radius = 0.0;
mutable double max_move_dist = 0.0;
NodeType type = eCircle;
bool is_merged = false; // this node is generated by merging upper nodes
bool is_corner = false;
const ExPolygon* overhang = nullptr; // when type==ePolygon, set this value to get original overhang area
bool is_processed = false;
const ExPolygon *overhang = nullptr; // when type==ePolygon, set this value to get original overhang area
/*!
* \brief The direction of the skin lines above the tip of the branch.