Printrun Projectlayer Update

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.

XY Calibration

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.

Projectlayer - Calibration

Projectlayer – Calibration

The key settings are the X and resolution (in pixels), plus the ProjectedX value (in mm).  The former should be set to the resolution of the projector (in my case 1024×768), and the latter to the full width of the image that is projected onto the bottom of the vat – not just what is visible in the vat of course, but the entire width of the projection.  (I should also note that the display should of course be set to “fullscreen”).  With these figures dialled in the calibrate checkbox should display a grid of 10mm² squares.  The ProjectedX parameter can be modified to fine tune.


It’s also worth testing with a few real models to make sure – the “1st layer” option is useful here.


If anyone uses this and comes across problems then please let me know.

Comments are closed.