[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 13:32 -0500, DJ Delorie wrote:
> I think the problem is that mm grid points are not exactly on 1/100mil
> coordinates, so two mm grid points that look diagonally opposite each
> other may not be exactly diagonal in 1/100mil space.
>
> The only way to "fix" this is to change to something other than
> 1/100mil internal coordinates.
Two solutions there..
1. Really high resolution integer coordinate space.
Reduces available board dimensions due to size of integers.
(Or go to floating-point.. -> Still limited precision for a big board).
2. A kind of semi-intrinsic coordinates, (think computer graphics,
where each coordinate vector also has a divisor. -> 3D coordinate has 4
numbers, with the fourth usually being "1").
We would presumably store value (multiplied by some desired precision)
and units. E.g. (1,5)mm ->
point->x.value = 1000000;
point->x.unit = PCB_UNIT_NM;
point->y.value = 5000000;
point->y.unit = PCB_UNIT_NM;
Or perhaps the * 1e6 would be implicit, and we'd call the units
PCB_UNIT_MM - whatever.
This scheme would mean we could no longer compare units easily, needing
to convert to a common format before comparing bounding boxes etc.., but
it does neatly solve the problem of retaining precision in arbitrary
units. (Ok... given a common origin to both systems!)
Further problems (whilst I'm thinking and typing), would be representing
coordinates which result as an intersection of points / geometry in
different coordinate systems. You'd quickly start needing to add more
precision, or descriptions of how to construct the location. The same
problem recurs - approx 45 degree lines would probably result.
> Alternately, we could allow lines to be not-quite-exactly-45-degrees,
> but I suspect a lot of the internals would get confused about that.
Probably confused, but part of me suspects this might be the best
solution.
One final thought.. could we round the width / height of the line to
internal coordinate units, and (say), the start-point, rather than both
end-points? That way, the line-drawing code could properly constrain the
drawn line to be diagonal.
--
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