[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: pcb circles turn into hexagons



On Thu, 2009-11-05 at 09:47 -0500, DJ Delorie wrote:
> What I've seen other software do, is calculate the offset from the
> center of the chord to the true circle, and limit that.  Which means
> the number of segments is proportional to the radius, relative to
> cos(x)...
> 
> we want to limit r * (1-cos(x)) < N
> 
> 1-cos(x) < N/r
> 
> cos(x) > 1-N/r
> x = acos (1-N/r)  (assuming N < r)
> 
> That's the half-angle, use x*2 as the segment's arc.

That was the kind of metric I was trying to put my finger on.. cobbled
together implementation here..

I'm not sure if this entirely right yet - I was surprised how low I had
to make the parameter "#define MAX_PIXELS_ARC_TO_CHORD 0.5" before the
approximation appeared to be perfect. Perhaps I got a scale factor wrong
somewhere.

Anyhow.. this is now pushed to the "local_customistaion_no_pours"
branch, so Kai-Martin, if you want to try it out and report back, I'd
appreciate it. The change does make refresh rate on complex boards go
down a little unfortunately.

Just a warning thoguh.. the branch is not "bug free" at the moment. I've
seen PCB segfault when dragging around the board in 3D.

Best wishes,

Peter C.


> _______________________________________________
> geda-user mailing list
> geda-user@xxxxxxxxxxxxxx
> http://www.seul.org/cgi-bin/mailman/listinfo/geda-user




_______________________________________________
geda-user mailing list
geda-user@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-user