#53 Improve PDF/PS export quality when there are knock-outs

Unstable (example)
open
nobody
None
5
2014-03-15
2014-03-15
Nicholas Vinen
No

When there are polygon pours with knock-outs, such as when pads are within polygon pours and thermal reliefs are being used, files exported in Postscript and PDF export tend to have very poor quality and are almost unusable as etching masks and so on. This is because the polygons are rendered to the Cairo surface used to render to the PS/PDF files as a solid fill with a cut-out then drawn on top, then the pads and tracks are drawn into this cut-out. Cairo handles this by "falling back" to rasterising the area around the pad and places the resulting bitmap image in the Postscript or PDF file but the default resolution for this image is 300DPI which is insufficient.

This change makes the resolution for these images 1000DPI, giving 1 pixel = 1 mil in the result, sufficient to give smooth edges under most circumstances. PS and PDF file size only grows modestly.

I want to investigate the possibility of actually doing polygon intersection calculations before sending data to Cairo so that the result is a pure vector image but that requires more work so this is a good interim solution.

1 Attachments

Discussion

  • Nicholas Vinen
    Nicholas Vinen
    2014-03-15

    Here is a very simple sample file which demonstrates the problem - compare PDF export before and after patch.

     
    Attachments
  • Nicholas Vinen
    Nicholas Vinen
    2014-03-15

    Here is a more complex (and real) example. Exported PDF file size for this layer only grows from 309430 bytes to 345254 bytes but rendering around the curved pads with solder reliefs (and to a lesser extent, the rectangular ones) is greatly improved. This improvement is more obvious if you zoom in when viewing the PDF.

     
    Attachments