-
Notifications
You must be signed in to change notification settings - Fork 311
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
Add automatic layer height detection #34
Comments
Submitted Pull request #26 to add automatic layer height detection via G-code comments |
According to https://help.prusa3d.com/article/post-processing-scripts_283913, you can also base it off of an environment variable. I'm assuming it's gonna be SLIC3R_LAYER_HEIGHT. Although, it might be more convenient to just detect from the file for users running post-processing manually. |
I've pushed a commit that will try to obtain the layer height from the SLIC3R_LAYER_HEIGHT environment variable. If that fails, it'll try to find the layer height from the G-code comments and if that fails, it'll use the command line argument -layerHeight. Even if -layerHeight isn't specified it does set a default value of 0.2mm so we should be safe and it covers those users who want to run it manually. I've also added a regex to support Simplify 3D G-code layerHeight comments. |
Currently, the layer height needs to be passed to the script via a command line parameter. In prusa slicer, I would need to have the post processing script set to the following on my mac:
"/Library/Frameworks/Python.framework/Versions/Current/bin/python3" "/Users/stutaki/iitggithub/Bricklayers/bricklayers.py" -layerHeight 0.2;
The script should use the G-code comments to determine the layer height the model was sliced at.
During testing i found that Prusa printers seem to mention the layer height like so:
; layer_height = 0.15
and from some digging around online, I believe Bambu Labs uses:
; Z_HEIGHT: 0.15
The text was updated successfully, but these errors were encountered: