← Back to team overview

kicad-developers team mailing list archive

Re: Gerber output units?

 

Le 04/08/2015 08:29, Lorenzo Marcantonio a écrit :
> On Tue, 04 Aug 2015 05:38:26 +0200,
> Chris Pavlina wrote:
>>
>> pcbnew used to be able to plot Gerbers in imperial units. What happened 
>> to that? Some (particularly older and non-Asian) board houses still 
>> expect those... Is there any reason they were removed, or did they just 
>> "fall out"? And can they be put back in?
> 
> Since the new plotting infrastructure the gerber plotter already
> supported both units; the IN was simply the compatibility default and it
> only needed an UI option to be bound.
> 
> If someone changed the default without adding a radio button or
> something then blame to him:P
> 
> AFAIK there would be no technical reason to not do inch plotting...
> 

There is a technical reason to not do inch plotting.
I recently explained it.

Pcbnew internally uses nanometers, corresponding to 6 digits mantissa in
Gerber.

If we use a 6 digits mantissa and mm in Gerber, there is no rounding issue.
If we convert these values to inches, I am pretty sure rounding issues
will appear.

For most of coordinates, a rounding issue has no matter.
However, for complex polygons (copper zones) rounding coordinates can
create self intersecting polygons from non intersecting polygons.
Self intersecting polygons are not allowed in Gerber files (see gerber
file format spec).

The advice from Ucamco is (especially for this issue) is:
use the max resolution for coordinates (see also the gerber file format
spec).


The only one reason the 5 digits mantissa option exists in Pcbnew is the
fact Ucamco told me a few Gerbers tools do not accept the 6 digits.

I verified some Gerber files which are OK with 6 digits mantissa create
self intersecting polygons when using 5 digits from the same board.
(Tests with GC-Preview)

(to tell the True, the Gerber image on screen was the same)

We already have a bug report about self intersecting polygons in Gerber
files from Kicad.

It also explains why a Gerber reader can gives warnings about that
issue, and an other Gerber reader does not find any issue: it depends
also on internal units of the reader.


Therefore, until someone give me a *very good reason* why inches are
better than mm in Gerber files, I *do not want* a inch option in Gerber
plot menu ( or, if this option exists, commit an algo to avoid self
intersecting polygons).

-- 
Jean-Pierre CHARRAS


Follow ups

References