[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA-user: transition of pcb internal units to metric (SI, mm)
On Feb 7, 2011, at 10:41 AM, DJ Delorie wrote:
>
> * nanometer internal units
>
> * 32-bit values on 32-bit machines, 64-bit on 64-bit.
>
> * configure option for 64-bit values regardless of machine in case you
> need a board larger than seven feet across.
What about storing both imperial and metric? This way, the measurements
are ket separate until the very last moment when they need to be converted
to one value. A metric element can be manipulated on screen in an imperial
grid and no errors build up.
Using a two column one row matrix, store both imperial and metric values.
The actual measurement is the sum of the two converted to the proper
units. In exclusively imperial or metric projects, one value will
be zero. In mixed projects, both may take on a non-zero value.
[imperial metric]
All arithmetic operations use matrix manipulation. For example, addition:
z.imperial = a.imperial + b.imperial
z.metric = a.metric + b.metric
Multiplication:
z.imperial = k * a.imperial
z.metric = k * b.metric
At the last moment, convert one value, add it to the other to get a single
number for output.
result = [ k0 ] * [imperial metric]
[ k1 ]
Where k0 and k1 are the appropriate conversion factors.
Cheers,
Ed
_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user