Sequential test changed from hard error to soft error (allowing export)

This commit is contained in:
Lukas Matena 2025-02-03 17:11:53 +01:00
parent 3bfcf1cc0b
commit 2d1b498d2b
8 changed files with 21 additions and 6 deletions

View File

@ -538,6 +538,7 @@ void GCodeProcessorResult::reset() {
custom_gcode_per_print_z = std::vector<CustomGCode::Item>();
spiral_vase_mode = false;
conflict_result = std::nullopt;
sequential_collision_detected = false;
}
const std::vector<std::pair<GCodeProcessor::EProducer, std::string>> GCodeProcessor::Producers = {

View File

@ -163,6 +163,7 @@ namespace Slic3r {
bool spiral_vase_mode;
ConflictResultOpt conflict_result;
bool sequential_collision_detected;
void reset();
};

View File

@ -462,11 +462,6 @@ std::string Print::validate(std::vector<std::string>* warnings) const
if (extruders.empty())
return _u8L("The supplied settings will cause an empty print.");
if (m_config.complete_objects) {
if (! check_seq_printability(m_model, m_config))
return _u8L("Some objects are too close; your extruder will collide with them.");
}
if (m_config.avoid_crossing_perimeters && m_config.avoid_crossing_curled_overhangs) {
return _u8L("Avoid crossing perimeters option and avoid crossing curled overhangs option cannot be both enabled together.");
}
@ -975,6 +970,8 @@ void Print::process()
if (conflictRes.has_value())
BOOST_LOG_TRIVIAL(error) << boost::format("gcode path conflicts found between %1% and %2%") % conflictRes->_objName1 % conflictRes->_objName2;
m_sequential_collision_detected = config().complete_objects && ! check_seq_printability(model(), config());
BOOST_LOG_TRIVIAL(info) << "Slicing process finished." << log_memory_info();
}
@ -1004,6 +1001,8 @@ std::string Print::export_gcode(const std::string& path_template, GCodeProcessor
if (m_conflict_result.has_value())
result->conflict_result = *m_conflict_result;
result->sequential_collision_detected = m_sequential_collision_detected;
return path.c_str();
}

View File

@ -749,6 +749,7 @@ private:
friend class PrintObject;
ConflictResultOpt m_conflict_result;
bool m_sequential_collision_detected;
};
} /* slic3r_Print_hpp_ */

View File

@ -1112,6 +1112,8 @@ void GCodeViewer::load_as_gcode(const GCodeProcessorResult& gcode_result, const
m_conflict_result = gcode_result.conflict_result;
if (m_conflict_result.has_value())
m_conflict_result->layer = m_viewer.get_layer_id_at(static_cast<float>(m_conflict_result->_height));
m_sequential_collision_detected = gcode_result.sequential_collision_detected;
}
void GCodeViewer::load_as_preview(libvgcode::GCodeInputData&& data)

View File

@ -261,6 +261,7 @@ private:
bool m_contained_in_bed{ true };
ConflictResultOpt m_conflict_result;
bool m_sequential_collision_detected{ false };
libvgcode::Viewer m_viewer;
bool m_loaded_as_preview{ false };
@ -357,6 +358,7 @@ public:
void invalidate_legend() { m_legend_resizer.reset(); }
const ConflictResultOpt& get_conflict_result() const { return m_conflict_result; }
bool get_sequential_collision_detected() const { return m_sequential_collision_detected; }
void load_shells(const Print& print);

View File

@ -2923,6 +2923,7 @@ void GLCanvas3D::load_gcode_preview(const GCodeProcessorResult& gcode_result, co
if (wxGetApp().is_editor()) {
_set_warning_notification_if_needed(EWarning::ToolpathOutside);
_set_warning_notification_if_needed(EWarning::GCodeConflict);
_set_warning_notification_if_needed(EWarning::SequentialCollision);
}
set_as_dirty();
@ -7365,6 +7366,8 @@ void GLCanvas3D::_set_warning_notification_if_needed(EWarning warning)
show = m_gcode_viewer.has_data() && !m_gcode_viewer.is_contained_in_bed();
else if (warning == EWarning::GCodeConflict)
show = m_gcode_viewer.has_data() && m_gcode_viewer.is_contained_in_bed() && m_gcode_viewer.get_conflict_result().has_value();
else if (warning == EWarning::SequentialCollision)
show = m_gcode_viewer.has_data() && m_gcode_viewer.get_sequential_collision_detected();
}
}
}
@ -7404,6 +7407,11 @@ void GLCanvas3D::_set_warning_notification(EWarning warning, bool state)
error = ErrorType::SLICING_ERROR;
break;
}
case EWarning::SequentialCollision: {
text = _u8L("Collision between an object and extruder gantry detected.");
error = ErrorType::SLICING_ERROR;
break;
}
}
auto& notification_manager = *wxGetApp().plater()->get_notification_manager();

View File

@ -373,7 +373,8 @@ class GLCanvas3D
SlaSupportsOutside,
SomethingNotShown,
ObjectClashed,
GCodeConflict
GCodeConflict,
SequentialCollision
};
class RenderStats