mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-12 06:52:57 +00:00
Fix brim of wipetower (same with 2.2.3)
This commit is contained in:
@@ -2081,13 +2081,21 @@ WipeTower::ToolChangeResult WipeTower2::finish_layer()
|
||||
// brim with chamfer (gradual layer-by-layer reduction)
|
||||
int loops_num = (m_wipe_tower_brim_width + spacing / 2.f) / spacing;
|
||||
|
||||
// Apply chamfer reduction if feature is enabled and brim width is configured
|
||||
if (m_wipe_tower_brim_width > 0 && m_prime_tower_brim_chamfer) {
|
||||
if (!first_layer) {
|
||||
// Apply brim logic based on chamfer setting
|
||||
if (m_wipe_tower_brim_width > 0) {
|
||||
if (first_layer) {
|
||||
// First layer: always print full brim (loops_num unchanged)
|
||||
} else if (m_prime_tower_brim_chamfer) {
|
||||
// Non-first layer + chamfer enabled: apply gradual reduction
|
||||
// Calculate distance from first layer with tool changes
|
||||
size_t current_idx = m_layer_info - m_plan.begin();
|
||||
int dist_to_1st = (int) current_idx - (int) m_first_layer_idx;
|
||||
|
||||
// Validate m_first_layer_idx to prevent invalid index access
|
||||
if (m_first_layer_idx == size_t(-1) || m_first_layer_idx >= m_plan.size()) {
|
||||
// Invalid first layer index, don't print brim
|
||||
loops_num = 0;
|
||||
} else {
|
||||
// Stop print chamfer if depth changes
|
||||
bool depth_changed = (m_layer_info->depth != m_plan[m_first_layer_idx].depth);
|
||||
if (depth_changed) {
|
||||
@@ -2101,6 +2109,10 @@ WipeTower::ToolChangeResult WipeTower2::finish_layer()
|
||||
loops_num = 0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Non-first layer + chamfer disabled: don't print brim (revert to original behavior)
|
||||
loops_num = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (loops_num > 0) {
|
||||
|
||||
Reference in New Issue
Block a user