ENH: improve tree support and fix a bug

1. use tree slim's merge strategy in hybrid support
2. do not break bridge in hybrid support
3. fix "support on buildplate only" not working. The cause is: with
   independent support layer height, contact_nodes are not synced with
   object layers, so the previous way of accessing contact nodes in
   unsupported_branch_leaves no longer works. To fix that, we add
   obj_layer_nr.
   Jira: STUDIO-2250

Change-Id: Idfc9b0bb10425de6414f7eae2cf5467cedf1d669
(cherry picked from commit 8780d5a7e92e298cbbccbb3bd1825197d387a340)
This commit is contained in:
Arthur 2023-02-15 14:20:31 +08:00 committed by Lane.Wei
parent 5df5cb9ff4
commit bf8f163b5a
2 changed files with 23 additions and 19 deletions

View file

@ -221,7 +221,7 @@ public:
Node()
: distance_to_top(0)
, position(Point(0, 0))
, skin_direction(false)
, obj_layer_nr(0)
, support_roof_layers_below(0)
, support_floor_layers_above(0)
, to_buildplate(true)
@ -230,11 +230,11 @@ public:
, height(0.0)
{}
Node(const Point position, const int distance_to_top, const bool skin_direction, const int support_roof_layers_below, const bool to_buildplate, Node* parent,
Node(const Point position, const int distance_to_top, const int obj_layer_nr, const int support_roof_layers_below, const bool to_buildplate, Node* parent,
coordf_t print_z_, coordf_t height_, coordf_t dist_mm_to_top_=0)
: distance_to_top(distance_to_top)
, position(position)
, skin_direction(skin_direction)
, obj_layer_nr(obj_layer_nr)
, support_roof_layers_below(support_roof_layers_below)
, support_floor_layers_above(0)
, to_buildplate(to_buildplate)
@ -298,6 +298,7 @@ public:
*/
int support_roof_layers_below;
int support_floor_layers_above;
int obj_layer_nr;
/*!
* \brief Whether to try to go towards the build plate.
@ -362,6 +363,7 @@ public:
InfillPattern interface_fill_pattern;
InfillPattern contact_fill_pattern;
bool with_sheath;
const double thresh_big_overhang = SQ(scale_(10));
};
int avg_node_per_layer = 0;