← Back to team overview

kicad-developers team mailing list archive

Re: [RFC 1/2] New coordinate framework


Le 21/11/2018 à 18:46, Simon Richter a écrit :
> Hi Wayne,
> On 21.11.2018 17:37, Wayne Stambaugh wrote:
>> If that is the end
>> goal of these changes, I'm all for it.  If not, I would prefer that this
>> be part of the redesign.  This should allow us to put the base units in
>> a kicad shared object.
> Yes, that is the main point of these changes, as well as some more
> compile-time error checking.
> We should in principle also be able to just switch all the conversion
> constants so that the entire code uses nanometers as internal units,
> which would be a rather minimal change, but I'm almost certain that
> there are some assumptions hidden inside the code still, and making
> coordinates effectively incompatible with scalars will force us to visit
> every place where constants are defined and explicitly specify a unit
> for them.
> The other thing it can probably allow us to do is instruct the compiler
> to detect coordinate overflows in Debug builds. I've already tried
> building the entire program with -ftrapv in order to find the point
> where the gtk3/Cairo problem originates, but there are quite a few
> places where the code uses integer overflow, so we get a lot of false
> positives there — however coordinates should never overflow.
>    Simon

Hi Simon,

what do you mean by:
"that the entire code uses nanometers as internal units"

This is *not possible* both in Eeschema and Gerbview.
Due to bigger working areas needed by Eeschema and Gerbview, the smaller
acceptable internal unit is 10 nanometers (working area size = 4x6
meters on Eeschema, and more in Gerbview).

In Pcbnew, one nanometer is used mainly to avoid any conversion issue
between inches and nanometers.
Without this constraint, 10 nm will be better.

In short: Eeschema, Gerbview and Pcbnew cannot use the same internal unit.

By the way, I am pretty sure the the gtk3/Cairo overflow issue is not
inside Kicad.
There is a similar issue (integer overflow) on Windows with postscript
(and pdf) drivers, ans only them, now fixed by using Cairo printing system.

Jean-Pierre CHARRAS

Follow ups