Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layer count differs from slicer's #1155

Closed
volconst opened this issue Jan 31, 2021 · 7 comments · Fixed by #1158
Closed

Layer count differs from slicer's #1155

volconst opened this issue Jan 31, 2021 · 7 comments · Fixed by #1158
Assignees

Comments

@volconst
Copy link
Collaborator

Hi @volconst and @kliment
can you give me a favor and load the attached gcode file in your latest build and then open the Gcode view?
The file should have a z high of 15mm with 75 layers. Pronterface tells me 77 Layers and Z=15.500mm. In addition the first layer says Layer 1 - Z = 15mm
Pronterface_test.zip

Originally posted by @DivingDuck in #1069 (comment)

@volconst
Copy link
Collaborator Author

One extra layer added by printrun is GCode.append_layer at the end of gcode parsing.
append_layer is referenced in GCode.append(self, command, store = True)
but append is called only once with store = False.
I think we can remove GCode.append_layer.
@kliment do you see any use of GCode.append_layer ?

@volconst volconst changed the title Layer count differ from slicer's Layer count differs from slicer's Jan 31, 2021
@kliment
Copy link
Owner

kliment commented Jan 31, 2021

I don't, but it's been so long since I touched any of that that I'm not certain about it.

@volconst volconst self-assigned this Feb 1, 2021
volconst added a commit to volconst/Printrun that referenced this issue Feb 1, 2021
volconst added a commit to volconst/Printrun that referenced this issue Feb 1, 2021
Do not count as a layer a height at which we have (+ or -) extrusion,
but no x,y movement. This excludes retraction and  priming.
Apply the same condition for end layer.
@volconst
Copy link
Collaborator Author

volconst commented Feb 1, 2021

@DivingDuck , can you test layer counting in this branch https://github.com/volconst/Printrun/tree/layer-counts ?

@volconst
Copy link
Collaborator Author

volconst commented Feb 1, 2021

@kliment , append_layer is probably meant to allow injecting of gcode at the end of the file.
Injecting adds to the beginning of layer and adding an empty layer allows to add at the end of the file.
But I could not select the append layer with the slider.
I dropped the idea to remove append_layer as it does not affect counting with the currently proposed changes.

@DivingDuck
Copy link
Collaborator

@volconst, the layer count of this version is correct and I see the behavior you mentioned as well.
After injecting additional code and then saving the gcode in a new file I can see two injections, one on the position I inject the code and an additional empty line at the end of the file.

@volconst
Copy link
Collaborator Author

volconst commented Feb 2, 2021

Thank you, @DivingDuck

@DivingDuck
Copy link
Collaborator

You're welcome, and thank you too, @volconst :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants