[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
Re: gEDA-user: pcb, how to remove mm garbage (very short lines)?
On Wed, 2008-11-19 at 15:44 -0700, John Doty wrote:
> If you insist on no artifacts, it's zero.
>
> If you round imperial units to the nearest 0.01 mil, you have no
> additional roundoff error if your fundamental unit is 1 nm, because
> 0.01 mil is *exactly* (by definition) 254 nm.
Good point... meaning it would be sensible to move towards some kind of
metric internal units, or an intrinsic coordinate system with units in
metric being given the divisor of 254 * 10^n.
> It's much harder to go the other way with a humanly comprehensible
> rounding because of the factor of 127 in the definition of the inch.
I get that 127 * 2 = 254.. which definition of the inch mentions 127
explicitly though?
> 2^32 nm is about 4.3 meters, large enough for any PCB I've ever seen.
> 2^64 nm is about 0.12 astronomical unit ;-)
Well.. I can't recall if we use signed or unsigned numbers throughout,
so we might end up limited at half those. Aren't 64 bit integers going
to be slow on a 32bit CPU?
Practicalities of changing:
1. Change internal units: ought not to be _that_ hard since DJ nicely
abstracted things away when he refactored to introduce the HID (IIRC).
Make loading / saving convert to the old units, (rounded to integers).
2. Add unit specifiers to file-format, so users could, if they want,
write out coordinates such as:
5mm, 10mm or 5 mm, 10 mm. from their footprint-generation scripts.
Save the files out with native units, e.g. "123456000 nm"
Perhaps, for optimal flare, we could make it more human readable, by
writing out something decimalised, like: 123.456 mm (*)
If the coordinates for a point happened to be a convenient decimal
fraction of an inch (requiring less decimal places / significant figures
than the metric representation), then we could choose to emit in mils,
or inches etc..
* (Taking care not to loose precision if we were to read it back via a
floating point number).
--
Peter Clifton
Electrical Engineering Division,
Engineering Department,
University of Cambridge,
9, JJ Thomson Avenue,
Cambridge
CB3 0FA
Tel: +44 (0)7729 980173 - (No signal in the lab!)
_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user