fix: preview slider shows non-support layer count instead of total Z … - #624
Open
mwz-iot wants to merge 1 commit into
Open
fix: preview slider shows non-support layer count instead of total Z …#624mwz-iot wants to merge 1 commit into
mwz-iot wants to merge 1 commit into
Conversation
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.
Description
This PR fixes the incorrect layer number display in Preview when Independent Support Layer Height is enabled.
GCodeViewer::m_layerscontains all sorted Z positions, including both model layers and support-only layers. The preview slider previously displayed the index inm_layersdirectly as the layer number.When independent support layer height is enabled, support paths can have additional Z positions that do not correspond to model layers. As a result:
This PR introduces a mapping from the preview Z index to the corresponding non-support model layer number.
The main changes include:
m_preview_to_non_support_layerinGCodeViewer::load_toolpaths().erSupportMaterialerSupportMaterialInterfaceerSupportTransition-1.GCodeViewertoIMSliderthroughGUI_Preview.--for support-only Z positions.The original
m_layersdata and slider range remain unchanged, so users can still navigate through all model and support paths.There are no breaking changes or new external dependencies introduced by this PR.
Screenshots/Recordings/Graphs
Before
The preview tooltip directly displayed the preview Z index as the layer number.
After enabling Independent Support Layer Height, support-only Z nodes were mixed
with model layers, causing the displayed layer number to exceed the actual model
layer count.
After - Model layer
Model Z positions display the correct model layer number.
After - Support-only Z
Support-only Z positions remain available in the slider and display
--insteadof an incorrect model layer number.
Tests
The following cases were tested:
--.