I recently updated my mod of Printrun’s projectlayer with a couple of important improvements which are worth sharing.
- Replaced wxpsvg with cairosvg.
Wxpsvg didn’t handle scaling correctly and so I decided to replace it with the better cairosvg module. This means there is a new dependency on pycairo (I installed via: pip install pycairo). Now each model should project to the correct size when the X and Y resolution, and the ProjectedX, values are set correctly, and the scale is set to 1. See below for a brief outline of my XY calibration technique.
- Slow SVG reading caused timing issues.
When the SVG file is large (e.g. > ~5MB) the time it took to convert to bitmap caused the image to not be displayed in time, as the original code worked on a fixed time schedule. I changed it slightly so that the displaying of the image waits for the bitmap to be ready before continuing. This means that the “Blank” time is now really the minimum blank time – it could blank longer if the SVG takes a while to convert, but at least the amount of time exposed should be always correct.
- Projectlayer settings are now saved between sessions.
- Show filename, layer count and estimated time for print.
- First layer can be displayed for a set number of seconds.
Setting a positive value in the number box next to the “1st Layer” checkbox will immediately display the first layer for that number of seconds. Useful for testing or for exposing the first layer for longer before starting the print. A value of -1 sets it to infinity.
It may also be worth mentioning how I calibrate the XY dimension of the printer. There may be better ways, but the following works for me.