[Xr] Xr API comments: Arcs

Paul Sladen xr at paul.sladen.org
Sat May 31 04:43:48 PDT 2003


On Mon, 26 May 2003, Carl Worth wrote:
> The only remaining problem is that I need an implementation that can
> break an elliptical arc into a sufficient number of cubic splines [...]

Arcs (including 360^ ones) need direct support.  The reason that Arcs
exist in every low-level drawing API is because they /cannot/ be accurately
approximated with Cubics...

Secondly, on scanline devices circular/elliptical arcs can be rendered
*incrementally* and do not need the overhead of converting to line-segments.

> I haven't planned to add rounded rectangles,

These are paths composed of 4 arcs and 4 lines.  This stuff is high-level...

> but the XrArcTo

Look very carefully at the Quartz support for Arcs, the two forms: {centre,
axial-radius, angle} and {point, point, point} are a nightmare to convert
between.  Both should probably be provided--with functions available in a
support-library to translate between the two.

  http://developer.apple.com/techpubs/macosx/CoreTechnologies/graphics/Quartz2D/Quartz_2D_Ref/qref_main/function_group_6.html
  http://www.google.com/search?btnI=I'm+Feeling+Lucky&q=CGContextBeginPath

	-Paul
-- 
War is inconsistent with Truth.  Nottingham, GB










More information about the cairo mailing list