Mailing list archives : pcb-rnd

ID:3568
From:ge...@igor2.repo.hu
Date:Fri, 29 Nov 2019 18:05:04 +0100 (CET)
Subject:Re: [pcb-rnd] inconsistent empty outline/boundary export
in-reply-to:3564 from cuvoodoo <pc...@cuvoodoo.info>
 
 
On Fri, 29 Nov 2019, cuvoodoo wrote:
 
>when nothing has been drawn in the outline layer (which I will call explicit), pcb-rnd shows lines on the border of the board area (which I will call implicit).
>when exporting the board, the outline/boundary layer is not always exported, and not always the same way:
>pcb-rnd -x ps: the implicit outline is drawn on the pages, but there is no separate page. an additional outline page is added for explicit outline
>pcb-rnd -x cam gerber:eagle: exports implicit and explicit boundary
>pcb-rnd -x gerber --name-style eagle unnamed.lht: only exports explicit boundary
>pcb-rnd -x cam gerber:JLC_PCB: only exports explicit boundary
>
>I did not test all combinations, but it is a bit inconsistent, particularly when using CAM jobs, which is meant to avoid this behaviour.
 
Thanks, fixed these in r28548 and r28549.
 
Funny thing is: it had nothing to do with CAM!
 
The two cam jobs that behave differently differ in config, in parameters 
passed to the gerber plugin. Some pass --all-layers, others don't. For 
gerber, this controls whether empty layer groups are exported or not.
 
However, the real bug is not related to --all-layers, and was present both 
in gerber and ps. And the real bug is a conceptual mistake: the boundary 
layer group can never be empty, because it will always either have an 
explicit drawing by the user, or the implicitly generated drawing-area 
rectangle. This means the boundary group's file always needs to be 
generated, even if it looks empty looking at the data. This shouldn't 
depend on --all-layers or whether we want to also copy the board outline 
to all layers (in case of ps). So this is what I fixed.
 
(This bug could affect only multi-file or multi-page exporters.)
 
Fine print for programmers:
 
And yes, the implicit board outline is a real ugly hack that causes a lot 
of special casing all around the code. Unfortunately we inherited this 
from pcb and a lot of old boards depend on it, so I don't think we'll get 
rid of it. The rendering code has a (mostly) inherited comment about this:
 
/* The implicit outline rectangle (or automatic outline rectanlge).
   We should check for pcb_render->gui here, but it's kinda cool seeing the
   auto-outline magically disappear when you first add something to
   the outline layer.  */
 
So we have this special case because some time ago someone though it was 
cool that it appeared and disappeared on screen, then we didn't want to 
export differently than how things are rendered on screen. Morale of the 
story: think twice before adding eye candy, it may be a burden we need to 
carry on for decades...
 
Best regarcs,
 
Igor2
 
 
 
 

Reply subtree:
3568 Re: [pcb-rnd] inconsistent empty outline/boundary export from ge...@igor2.repo.hu