mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
FIX: fix hybrid tree support may go outside plate
1. fix hybrid tree support may go outside plate github: #4769 2. fix false alarm of empty layer warning jira: STUDIO-8178 Change-Id: I7bcc3959b06184901cbec946e8840c7a94bc1cab (cherry picked from commit 647bd4213c363eff6258992f5f607c1f03cbc482)
This commit is contained in:
parent
3e7e4df7ce
commit
724d8a12b6
3 changed files with 19 additions and 4 deletions
|
@ -1202,14 +1202,23 @@ std::vector<GCode::LayerToPrint> GCode::collect_layers_to_print(const PrintObjec
|
||||||
// Allow empty support layers, as the support generator may produce no extrusions for non-empty support regions.
|
// Allow empty support layers, as the support generator may produce no extrusions for non-empty support regions.
|
||||||
|| (layer_to_print.support_layer /* && layer_to_print.support_layer->has_extrusions() */)) {
|
|| (layer_to_print.support_layer /* && layer_to_print.support_layer->has_extrusions() */)) {
|
||||||
double top_cd = object.config().support_top_z_distance;
|
double top_cd = object.config().support_top_z_distance;
|
||||||
double bottom_cd = object.config().support_bottom_z_distance;
|
double bottom_cd = object.config().support_bottom_z_distance == 0. ? top_cd : object.config().support_bottom_z_distance;
|
||||||
|
//if (!object.print()->config().independent_support_layer_height)
|
||||||
|
{ // the actual support gap may be larger than the configured one due to rounding to layer height for organic support, regardless of independent support layer height
|
||||||
|
top_cd = std::ceil(top_cd / object.config().layer_height) * object.config().layer_height;
|
||||||
|
bottom_cd = std::ceil(bottom_cd / object.config().layer_height) * object.config().layer_height;
|
||||||
|
}
|
||||||
double extra_gap = (layer_to_print.support_layer ? bottom_cd : top_cd);
|
double extra_gap = (layer_to_print.support_layer ? bottom_cd : top_cd);
|
||||||
|
|
||||||
// raft contact distance should not trigger any warning
|
// raft contact distance should not trigger any warning
|
||||||
if(last_extrusion_layer && last_extrusion_layer->support_layer)
|
if (last_extrusion_layer && last_extrusion_layer->support_layer) {
|
||||||
|
double raft_gap = object.config().raft_contact_distance.value;
|
||||||
|
//if (!object.print()->config().independent_support_layer_height)
|
||||||
|
{
|
||||||
|
raft_gap = std::ceil(raft_gap / object.config().layer_height) * object.config().layer_height;
|
||||||
|
}
|
||||||
extra_gap = std::max(extra_gap, object.config().raft_contact_distance.value);
|
extra_gap = std::max(extra_gap, object.config().raft_contact_distance.value);
|
||||||
|
}
|
||||||
double maximal_print_z = (last_extrusion_layer ? last_extrusion_layer->print_z() : 0.)
|
double maximal_print_z = (last_extrusion_layer ? last_extrusion_layer->print_z() : 0.)
|
||||||
+ layer_to_print.layer()->height
|
+ layer_to_print.layer()->height
|
||||||
+ std::max(0., extra_gap);
|
+ std::max(0., extra_gap);
|
||||||
|
|
|
@ -1662,6 +1662,9 @@ void TreeSupport::generate()
|
||||||
create_tree_support_layers();
|
create_tree_support_layers();
|
||||||
m_ts_data = m_object->alloc_tree_support_preview_cache();
|
m_ts_data = m_object->alloc_tree_support_preview_cache();
|
||||||
m_ts_data->is_slim = is_slim;
|
m_ts_data->is_slim = is_slim;
|
||||||
|
// // get the ring of outside plate
|
||||||
|
// auto tmp= diff_ex(offset_ex(m_machine_border, scale_(100)), m_machine_border);
|
||||||
|
// if (!tmp.empty()) m_ts_data->m_machine_border = tmp[0];
|
||||||
|
|
||||||
std::vector<TreeSupport3D::SupportElements> move_bounds(m_highest_overhang_layer + 1);
|
std::vector<TreeSupport3D::SupportElements> move_bounds(m_highest_overhang_layer + 1);
|
||||||
profiler.stage_start(STAGE_GENERATE_CONTACT_NODES);
|
profiler.stage_start(STAGE_GENERATE_CONTACT_NODES);
|
||||||
|
@ -2093,6 +2096,7 @@ void TreeSupport::draw_circles()
|
||||||
|
|
||||||
// join roof segments
|
// join roof segments
|
||||||
roof_areas = diff_clipped(offset2_ex(roof_areas, line_width_scaled, -line_width_scaled), get_collision(false));
|
roof_areas = diff_clipped(offset2_ex(roof_areas, line_width_scaled, -line_width_scaled), get_collision(false));
|
||||||
|
roof_areas = intersection_ex(roof_areas, m_machine_border);
|
||||||
roof_1st_layer = diff_clipped(offset2_ex(roof_1st_layer, line_width_scaled, -line_width_scaled), get_collision(false));
|
roof_1st_layer = diff_clipped(offset2_ex(roof_1st_layer, line_width_scaled, -line_width_scaled), get_collision(false));
|
||||||
|
|
||||||
// roof_1st_layer and roof_areas may intersect, so need to subtract roof_areas from roof_1st_layer
|
// roof_1st_layer and roof_areas may intersect, so need to subtract roof_areas from roof_1st_layer
|
||||||
|
@ -3460,6 +3464,7 @@ const ExPolygons& TreeSupportData::calculate_collision(const RadiusLayerPair& ke
|
||||||
|
|
||||||
ExPolygons collision_areas = offset_ex(m_layer_outlines[key.layer_nr], scale_(key.radius+m_xy_distance));
|
ExPolygons collision_areas = offset_ex(m_layer_outlines[key.layer_nr], scale_(key.radius+m_xy_distance));
|
||||||
collision_areas = expolygons_simplify(collision_areas, scale_(m_radius_sample_resolution));
|
collision_areas = expolygons_simplify(collision_areas, scale_(m_radius_sample_resolution));
|
||||||
|
// collision_areas.emplace_back(m_machine_border);
|
||||||
const auto ret = m_collision_cache.insert({ key, std::move(collision_areas) });
|
const auto ret = m_collision_cache.insert({ key, std::move(collision_areas) });
|
||||||
return ret.first->second;
|
return ret.first->second;
|
||||||
}
|
}
|
||||||
|
|
|
@ -251,6 +251,7 @@ public:
|
||||||
std::vector<LayerHeightData> layer_heights;
|
std::vector<LayerHeightData> layer_heights;
|
||||||
|
|
||||||
std::vector<SupportNode*> contact_nodes;
|
std::vector<SupportNode*> contact_nodes;
|
||||||
|
// ExPolygon m_machine_border;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/*!
|
/*!
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue