Fix multiple issues: PETG-HF type, Chinese comments, Klipper wizard, spiral lift, color matching, prime tower, filament preprocessing, by-object print, filament density, calibration models, login persistence, filament selections#190
Open
kbaker827 wants to merge 13 commits intoSnapmaker:mainfrom
Conversation
…er pages in wizard
…vigation so Klipper/Custom printers can be selected
…GCodeWriter Add BoundingBoxf m_bed_bbox member to track the print bed extents for use in spiral lift boundary checking.
Implement the TODO in GCodeWriter::travel_to_xyz() to check if the spiral lift arc stays within the bed boundary. If the arc would go outside the bed extents, automatically fall back to lazy lift instead. This allows models to be positioned anywhere on the build plate without triggering warnings about spiral lifting and bed boundaries. The 3.5mm clearance warning is no longer needed as the slicer now handles the case automatically.
…laration Change deal_approximate_match_btn() to accept an optional DeltaE76 threshold parameter. Add deal_add_unmatched_filaments() declaration which only adds new filament slots for model colors that didn't match any existing filament within the threshold.
…before adding new ones Bug: deal_default_strategy() called deal_add_btn() first (which added all model colors as new filament slots), then deal_approximate_match_btn(). Since the newly-added exact-match slots dominated the distance search, approximate matching against the original filaments never happened. Fix: - deal_approximate_match_btn() now takes an optional DeltaE76 threshold (default -1 = no threshold, preserving manual Color Match button behavior) - New deal_add_unmatched_filaments() only adds new slots for model colors that exceeded the threshold distance from all existing filaments - deal_default_strategy() now: reset -> match with threshold=10 -> add unmatched DeltaE76=10 means perceptibly different colors; typical white/off-white variations (DeltaE~2-5) will reuse the existing filament slot instead of creating a redundant new one.
…ary; fix default tower position Issue Snapmaker#121 - Stabilization cone ("Fillet wall") extends beyond bed boundary: The default Snapmaker process profile sets wipe_tower_cone_angle=40deg, which causes the arc-shaped cone base to reach beyond the bed's printable area when the tower is placed near the edge, triggering "x-axis out of range" errors on the U1 and similar printers. Fix: store m_bed_height in WipeTower2 (parallel to existing m_bed_width) and clamp the cone radius r so the arc stays within the rectangular bed boundary before generating any G-code arc points. Issue Snapmaker#135 - Prime tower placed outside build plate on multi-plate projects: set_default_wipe_tower_pos_for_plate() hard-coded y=250, which is exactly the bed top for the Snapmaker A250 (230x250mm). The tower depth pushed it beyond the bed boundary. Fix: read printable_area from the printer preset at plate-creation time and compute default_x = bed_width - tower_width - 10, default_y = bed_height - 30 - 10, so the initial placement is always within the actual bed bounds.
…ary; fix default tower position Issue Snapmaker#121 - Stabilization cone ("Fillet wall") extends beyond bed boundary: The default Snapmaker process profile sets wipe_tower_cone_angle=40deg, which causes the arc-shaped cone base to reach beyond the bed's printable area when the tower is placed near the edge, triggering "x-axis out of range" errors on the U1 and similar printers. Fix: store m_bed_height in WipeTower2 (parallel to existing m_bed_width) and clamp the cone radius r so the arc stays within the rectangular bed boundary before generating any G-code arc points. Issue Snapmaker#135 - Prime tower placed outside build plate on multi-plate projects: set_default_wipe_tower_pos_for_plate() hard-coded y=250, which is exactly the bed top for the Snapmaker A250 (230x250mm). The tower depth pushed it beyond the bed boundary. Fix: read printable_area from the printer preset at plate-creation time and compute default_x = bed_width - tower_width - 10, default_y = bed_height - 30 - 10, so the initial placement is always within the actual bed bounds.
…ary; fix default tower position Issue Snapmaker#121 - Stabilization cone ("Fillet wall") extends beyond bed boundary: The default Snapmaker process profile sets wipe_tower_cone_angle=40deg, which causes the arc-shaped cone base to reach beyond the bed's printable area when the tower is placed near the edge, triggering "x-axis out of range" errors on the U1 and similar printers. Fix: store m_bed_height in WipeTower2 (parallel to existing m_bed_width) and clamp the cone radius r so the arc stays within the rectangular bed boundary before generating any G-code arc points. Issue Snapmaker#135 - Prime tower placed outside build plate on multi-plate projects: set_default_wipe_tower_pos_for_plate() hard-coded y=250, which is exactly the bed top for the Snapmaker A250 (230x250mm). The tower depth pushed it beyond the bed boundary. Fix: read printable_area from the printer preset at plate-creation time and compute default_x = bed_width - tower_width - 10, default_y = bed_height - 30 - 10, so the initial placement is always within the actual bed bounds.
Fixes not yet in the PR branch, now added: Fix Snapmaker#103/Snapmaker#114 — Filament density zero - Snapmaker PLA SnapSpeed.json: density "0" → "1.25" - Snapmaker fdm_filament_common.json: density "0" → "1.24" Fix Snapmaker#159 — Calibration models non-manifold on macOS/Linux - calib_temp: upper and lower cuts now use -EPSILON (was +EPSILON) to cut just below each flat block face, avoiding degenerate geometry - calib_max_vol_speed, calib_VFA, calib_retraction: same -EPSILON applied Fix Snapmaker#116 — Snapmaker login credentials not persisted on macOS/Linux - WebSMUserLoginDialog: saves sm_user_token / sm_user_name / sm_user_icon_url to AppConfig immediately after login; calls save() once all three are known - GUI_App::init_app_config(): restores login state from AppConfig on startup - GUI_App::sm_request_user_logout(): clears all three keys and saves Fix (Flatpak) — "Cannot register URI scheme wxfs more than once" - Widgets/WebView.cpp: added static s_handlers_registered guard in the non-Windows branch of CreateWebView() so wxfs and memory handlers are registered exactly once per process lifetime Fix Snapmaker#101 — Filament selections not saved after Add/Remove Filaments wizard - ConfigWizard: added app_config->save() after export_selections() in apply_config() so selections survive an immediate app exit Fix Snapmaker#136 — By-object print causes toolhead collision on IDEX - GCode.cpp: reordered inter-object travel: retract → travel_to_z (m_max_layer_z) → set_extruder (if needed) → travel_to(origin) so the nozzle is at safe height before the toolchange move Fix Snapmaker#115 — Filament not showing in Print Preprocessing window - PresetBundle::load_selections() and update_selections(): only replace filament presets that no longer exist, not merely invisible/incompatible - SelectMachine::reset_and_sync_ams_list(): replaced O(n²) linear scan with find_preset() (visibility-agnostic) for correct index alignment Code quality — WipeTower2 cone radius clamp (issue Snapmaker#121) - Extended clamp to all bed shapes: circular beds now use a distance- from-bed-center check; custom/rectangular beds use bounding-box margins Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes 15 separate issues:
Fix #96 — PETG-HF filament type not recognized
Fix #138 — Chinese comments in Print.cpp
Fix #179 — Generic Klipper / 3rd-party printers cannot be selected in ConfigWizard
Fix #161 — Spiral lifting 3.5mm boundary warning / unusable bed area
Fix #172 — Smart Color Matching (duplicate/near-identical filament slots on import)
Fix #121 — Prime tower "Fillet wall" causes x-axis out-of-range error
Fix #135 — Prime tower placed outside build plate on multi-plate projects
Fix #115 — Filament not showing in Print Preprocessing window
Fix #136 — By-object print causes toolhead collision
Fix #103 #114 — Filament density 0 → zero weight and U1 filament rejection
Fix #159 — Calibration models non-manifold/unsliceable on macOS and Linux
Fix #116 — Snapmaker login credentials not persisted on macOS/Linux
Fix #164 — Linux Flatpak crashes: "Cannot register URI scheme wxfs more than once"
Fix #101 — Filament selections not saved after Add/Remove Filaments wizard
Test plan
🤖 Generated with Claude Code