ENH: improve hybrid tree support

1. do not add interface for small overhangs so supports are easier to
   remove
2. calculate avoidance more accurately using real layer height
  jira: STUDIO-6285
3. hybrid nodes won't collide with lower layers
4. calculate max move more accurately
5. do not increase radius if next layer has collision
  jira: STUDIO-2296, STUDIO-7883
6. rewrite plan_layer_heights to prevent support layers overlap.
  Now the tree support layers are completely independent to object layers.
6. increase collision areas for interface. The top layers may be too
close to interface with adaptive layer heights and very small overhang angle

Change-Id: I052c3f66e68afb7663e2d70c846dd09ed7086071
(cherry picked from commit aca511caebfdeec270d4fc0ec6bbbadde77cddc9)
(cherry picked from commit f2fc996652b3b204b4e554f57afed8519feb0397)
This commit is contained in:
Arthur 2024-07-22 10:52:37 +08:00 committed by Noisyfox
parent 532dcae37a
commit 5054ee8508
5 changed files with 479 additions and 425 deletions

View file

@ -845,14 +845,8 @@ void PrintObject::clear_support_layers()
std::shared_ptr<TreeSupportData> PrintObject::alloc_tree_support_preview_cache()
{
if (!m_tree_support_preview_cache) {
const coordf_t layer_height = m_config.layer_height.value;
const coordf_t xy_distance = m_config.support_object_xy_distance.value;
const double angle = m_config.tree_support_branch_angle.value * M_PI / 180.;
const coordf_t max_move_distance
= (angle < M_PI / 2) ? (coordf_t)(tan(angle) * layer_height) : std::numeric_limits<coordf_t>::max();
const coordf_t radius_sample_resolution = g_config_tree_support_collision_resolution;
m_tree_support_preview_cache = std::make_shared<TreeSupportData>(*this, xy_distance, max_move_distance, radius_sample_resolution);
m_tree_support_preview_cache = std::make_shared<TreeSupportData>(*this, xy_distance, g_config_tree_support_collision_resolution);
}
return m_tree_support_preview_cache;