mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-11 11:07:40 +00:00
Fix: restore atomic node invalidation in TreeSupport::drop_nodes + drop unused var (R3, R9)
The 2-node merge moved the two valid=false writes outside the mutex that upstream held together with the contact_nodes push_back; restore a single critical section per branch (belt branch also guards to_buildplate). Remove an unused top_interface_layers local in drop_nodes.
This commit is contained in:
@@ -2859,7 +2859,6 @@ void TreeSupport::drop_nodes()
|
|||||||
const size_t tip_layers = base_radius / layer_height; //The number of layers to be shrinking the circle to create a tip. This produces a 45 degree angle.
|
const size_t tip_layers = base_radius / layer_height; //The number of layers to be shrinking the circle to create a tip. This produces a 45 degree angle.
|
||||||
const coordf_t radius_sample_resolution = m_ts_data->m_radius_sample_resolution;
|
const coordf_t radius_sample_resolution = m_ts_data->m_radius_sample_resolution;
|
||||||
const bool support_on_buildplate_only = config.support_on_build_plate_only.value;
|
const bool support_on_buildplate_only = config.support_on_build_plate_only.value;
|
||||||
const size_t top_interface_layers = config.support_interface_top_layers.value;
|
|
||||||
const auto belt_floor_mode = m_print_config->belt_support_floor_mode.value;
|
const auto belt_floor_mode = m_print_config->belt_support_floor_mode.value;
|
||||||
const bool has_belt_floor = std::abs(m_slicing_params.belt_floor_shear_factor) > EPSILON
|
const bool has_belt_floor = std::abs(m_slicing_params.belt_floor_shear_factor) > EPSILON
|
||||||
&& belt_floor_mode == BeltSupportFloorMode::GeneratorOnly;
|
&& belt_floor_mode == BeltSupportFloorMode::GeneratorOnly;
|
||||||
@@ -3100,19 +3099,21 @@ void TreeSupport::drop_nodes()
|
|||||||
// Treat as object-surface termination (not buildplate) so
|
// Treat as object-surface termination (not buildplate) so
|
||||||
// the node gets floor/interface areas instead of base pads.
|
// the node gets floor/interface areas instead of base pads.
|
||||||
if (has_belt_floor && print_z_next <= belt_floor_print_z(next_position)) {
|
if (has_belt_floor && print_z_next <= belt_floor_print_z(next_position)) {
|
||||||
|
std::scoped_lock lock(m_ts_data->m_mutex);
|
||||||
node_parent->to_buildplate = false;
|
node_parent->to_buildplate = false;
|
||||||
|
neighbour->valid = false;
|
||||||
|
p_node->valid = false;
|
||||||
} else {
|
} else {
|
||||||
const bool to_buildplate = !is_inside_ex(get_collision(0, obj_layer_nr_next), next_position);
|
const bool to_buildplate = !is_inside_ex(get_collision(0, obj_layer_nr_next), next_position);
|
||||||
SupportNode* next_node = m_ts_data->create_node(next_position, node_parent->distance_to_top + 1, obj_layer_nr_next,
|
SupportNode* next_node = m_ts_data->create_node(next_position, node_parent->distance_to_top + 1, obj_layer_nr_next,
|
||||||
node_parent->support_roof_layers_below - (node_parent->distance_to_top >= 0 ? 1 : 0),
|
node_parent->support_roof_layers_below - (node_parent->distance_to_top >= 0 ? 1 : 0),
|
||||||
to_buildplate, node_parent, print_z_next, height_next);
|
to_buildplate, node_parent, print_z_next, height_next);
|
||||||
get_max_move_dist(next_node);
|
get_max_move_dist(next_node);
|
||||||
m_ts_data->m_mutex.lock();
|
std::scoped_lock lock(m_ts_data->m_mutex);
|
||||||
contact_nodes[layer_nr_next].push_back(next_node);
|
contact_nodes[layer_nr_next].push_back(next_node);
|
||||||
m_ts_data->m_mutex.unlock();
|
neighbour->valid = false;
|
||||||
|
p_node->valid = false;
|
||||||
}
|
}
|
||||||
neighbour->valid = false;
|
|
||||||
p_node->valid = false;
|
|
||||||
}
|
}
|
||||||
else if (neighbours.size() > 1) //Don't merge leaf nodes because we would then incur movement greater than the maximum move distance.
|
else if (neighbours.size() > 1) //Don't merge leaf nodes because we would then incur movement greater than the maximum move distance.
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user