X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com Message-ID: <4ED3B931.9030008@iae.nl> Date: Mon, 28 Nov 2011 17:39:13 +0100 From: myken User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1 MIME-Version: 1.0 To: geda-user AT delorie DOT com Subject: Re: [geda-user] Mathematics of the arc element in pcb. References: <20111127221519 DOT GG4766 AT malakian DOT lan> In-Reply-To: <20111127221519.GG4766@malakian.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 28 Nov 2011 16:39:07.0833 (UTC) FILETIME=[3FA16290:01CCADEC] X-RcptDomain: delorie.com Reply-To: geda-user AT delorie DOT com On 27-11-11 23:15, Andrew Poelstra wrote: > On Sun, Nov 27, 2011 at 10:36:03PM +0100, myken AT iae DOT nl wrote: >> Hello all, >> >> I'm working on some functionality in pcb and I have a question. >> >> The question is about the start angle and the delta of an Arc element in pcb. >> If I draw an Arc in pcb then I will get the following entry in my pcb file: >> Arc [X Y Width Height Thickness Clearance StartAngle DeltaAngle SFlags] >> (no not literally but I hope you know what I mean ;-). >> >> If the Width and the Height are the same the start angle (45 degrees) and >> the delta (90 degrees) work as expected, >> Arc[200000 150000 20000 20000 100 200 45 90 "clearline"] >> >> But if the Width and the Height are not the same, it looks like the start >> angle and the delta are totally ignored. >> Arc[200000 150000 30000 20000 100 200 45 90 "clearline"] >> >> Can anyone explain to me the mathematics behind the Arc element or point >> me to the source code that does the mathematics? >> > As DJ said, width and height are applied as stretching, after a circular > arc has been drawn with the given angles. StartAngle 0 means the arc > starts at the left (opposite of traditional maths in which angles usually > start at the right), and increase counter-clockwise. > > The HID's all draw stretched arcs in this way, except Peter Clifton's > GL code, which still does not support them. It draws circular arcs using > Width as the radius. > > Further, any "real" code which looks for intersections, connectivity, etc, > only uses the width/height to calculate the endpoints. For the body of the > arc, almost all of it just assumes a circular arc (using Width as the > radius). So when using stretched arcs, you'll have all sorts of DRC and > connectivity troubles. > > Also rotations don't work properly. > > Officially, pcb does not support stretched arcs for these reasons. > > > > If you're willing to donate some time and numerical analysis to get this > stuff working well, that'd be wonderful. Peter C. has suggested just > getting rid of arcs and using bezier curves for everything, but you can't > do elliptical arcs with bezier curves :( > Ok, thanks. For now I will assume WIDTH != HEIGHT is not supported. Which basically means pcb only supports circles or parts of a circle. Is there a need or wish for proper working arc's? If so, why?