mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-04 00:32:08 +00:00
PA_Line Calibration QOL improvements and tweaks (#14440)
* fix: constrain PA_Line calibration bounding box to model geometry - PA_Line bounding box now uses actual model convex hull for X constraint instead of full printable area - Skip EXCLUDE_OBJECT_DEFINE for PA_Line mode (single object, no exclusion needed) - Add tool config files to .gitignore * modified: .gitignore * fix: add gcode type annotations and fix box height in PA line calibration - Label calibration segments with appropriate TYPE comments (Outer wall, Bottom surface, Top surface, Custom) for proper gcode processing - Fix bounding box height calculation to account for z_offset - Add LAYER_CHANGE and HEIGHT comments for multi-layer numbering display * fix: lock PA_Line bounding box X to bed centre instead of model hull * Added extra TYPE to ensure text/numbers/glyphs are labelled correctly ` gcode << ";TYPE:Outer wall\n"; ` * Remove hardcoded Perl path in OpenSSL.cmake Remove hardcoded Perl path for Windows configuration. * Add cross compilation support for Windows in OpenSSL.cmake * Remove unnecessary blank line in OpenSSL.cmake * Set perl config command back to variable Accidentally uploaded version with hardcoded path for my local environment * whitespace adjustment in previous * removed personal .gitignore config Remove specific files and directories from .gitignore. * Fix box height parameter in DrawBoxOptArgs Update DrawBoxOptArgs to use `m_height_layer` instead of `m_height_layer*2+z_offset`. This isn't a Z coordinate, it's a layer height * Replace hardcoded extrusion type with call to `GCodeProcessor::reserved_tag` Etags * Get pa_line bounding box from actual calibration variables Updated calibration line bounding box calculation to use actual geometry for X bounds, using a fake call to generate the calibration pattern. This will accurately get the size of the calibration pattern, massively reducing wasted time from bed mesh probing. * Implement print_extents method in CalibPressureAdvanceLine Add print_extents method to calculate bounding box extents based on bed dimensions. * Declare print_extents method in CalibPressureAdvanceLine Added print_extents method to return X-bounds of the pattern. * Fixed whitespace issues * Adjust print_extents to account for delta printers Check if the printer is delta layout and adjust bed dimensions if so. Used code from `CalibPressureAdvanceLine::generate_test` * Added semicolons to reserved tags Didn't realise etags wouldn't add semicolon - added these * only include number list in bounding box if number list is used Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * avoid bounding box overflowing bed * Tabs to spaces --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ian Bassi <ian.bassi@outlook.com>
This commit is contained in:
@@ -3246,7 +3246,8 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
||||
|
||||
BoundingBoxf bbox;
|
||||
auto pts = std::make_unique<ConfigOptionPoints>();
|
||||
if (print.calib_mode() == CalibMode::Calib_PA_Line || print.calib_mode() == CalibMode::Calib_PA_Pattern) {
|
||||
if (print.calib_mode() == CalibMode::Calib_PA_Pattern) {
|
||||
//PA_Pattern can have any size or arrangement - not dependent on 3mf model size
|
||||
bbox = bbox_bed;
|
||||
bbox.offset(-25.0);
|
||||
// add 4 corner points of bbox into pts
|
||||
@@ -3256,6 +3257,22 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
||||
pts->values.emplace_back(bbox.max.x(), bbox.max.y());
|
||||
pts->values.emplace_back(bbox.min.x(), bbox.max.y());
|
||||
|
||||
} else if (print.calib_mode() == CalibMode::Calib_PA_Line) {
|
||||
// Derive X bounds from the actual calibration geometry.
|
||||
CalibPressureAdvanceLine temp_pa_line_forsize(this);
|
||||
BoundingBoxf pattern_extents = temp_pa_line_forsize.print_extents(bbox_bed);
|
||||
|
||||
bbox = bbox_bed;
|
||||
bbox.offset(-25.0);
|
||||
bbox.min.x() = std::max(pattern_extents.min.x(), bbox.min.x());
|
||||
bbox.max.x() = std::min(pattern_extents.max.x(), bbox.max.x());
|
||||
|
||||
pts->values.reserve(4);
|
||||
pts->values.emplace_back(bbox.min.x(), bbox.min.y());
|
||||
pts->values.emplace_back(bbox.max.x(), bbox.min.y());
|
||||
pts->values.emplace_back(bbox.max.x(), bbox.max.y());
|
||||
pts->values.emplace_back(bbox.min.x(), bbox.max.y());
|
||||
|
||||
} else {
|
||||
// Convex hull of the 1st layer extrusions, for bed leveling and placing the initial purge line.
|
||||
// It encompasses the object extrusions, support extrusions, skirt, brim, wipe tower.
|
||||
@@ -7532,7 +7549,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
|
||||
// If adaptive PA is enabled, by default evaluate PA on all extrusion moves
|
||||
bool is_pa_calib = m_curr_print->calib_mode() == CalibMode::Calib_PA_Line ||
|
||||
m_curr_print->calib_mode() == CalibMode::Calib_PA_Pattern ||
|
||||
m_curr_print->calib_mode() == CalibMode::Calib_PA_Tower;
|
||||
m_curr_print->calib_mode() == CalibMode::Calib_PA_Tower;
|
||||
bool evaluate_adaptive_pa = false;
|
||||
bool role_change = (m_last_extrusion_role != path.role());
|
||||
if (!is_pa_calib && FILAMENT_CONFIG(adaptive_pressure_advance) && FILAMENT_CONFIG(enable_pressure_advance)) {
|
||||
@@ -9087,7 +9104,7 @@ std::string GCode::set_object_info(Print *print) {
|
||||
std::ostringstream gcode;
|
||||
size_t object_id = 0;
|
||||
// Orca: check if we are in pa calib mode
|
||||
if (print->calib_mode() == CalibMode::Calib_PA_Line || print->calib_mode() == CalibMode::Calib_PA_Pattern) {
|
||||
if (print->calib_mode() == CalibMode::Calib_PA_Pattern) {
|
||||
BoundingBoxf bbox_bed(print->config().printable_area.values);
|
||||
bbox_bed.offset(-25.0);
|
||||
Polygon polygon_bed;
|
||||
@@ -9098,6 +9115,8 @@ std::string GCode::set_object_info(Print *print) {
|
||||
gcode << "EXCLUDE_OBJECT_DEFINE NAME="
|
||||
<< "Orca-PA-Calibration-Test"
|
||||
<< " CENTER=" << 0 << "," << 0 << " POLYGON=" << polygon_to_string(polygon_bed, print, true) << "\n";
|
||||
} else if (print->calib_mode() == CalibMode::Calib_PA_Line) {
|
||||
// PA_Line has only one object, no EXCLUDE_OBJECT_DEFINE needed
|
||||
} else {
|
||||
size_t unique_id = 0;
|
||||
for (PrintObject* object : print->objects()) {
|
||||
|
||||
Reference in New Issue
Block a user