W3C home > Mailing lists > Public > www-svg@w3.org > August 2005

Re: Convert path arcs to cubic splines?

From: Thomas DeWeese <Thomas.DeWeese@Kodak.com>
Date: Sat, 06 Aug 2005 15:17:34 -0400
Message-ID: <42F50CCE.6000607@Kodak.com>
To: Mark McKay <mark@kitfox.com>
CC: www-svg@w3.org

Mark McKay wrote:

> I have looked at Batik.  They deal with th eproblem by implementing a 
> completely new general path that uses actual arcs to draw the arcs.

    No it simply stores the arc info so that it doesn't get markers


    All the drawing is done via the contained GeneralPath.

> (GerenalPath is frusteratingly declared final)  This is quite a bit 
> different from converting arcs to splines.  

    Take a closer look, in particular the 'computeArc' class that
calculates an Arc2D which when added to a GeneralPath is converted
to cubics for you.

> From what I remember, ExtendedGeneralPath also has a whole lot 
> of dependancies.  I'd prefer to simply come up with the 
> arc/spline aproximation if I can.
> Also, this is for my SVG Salamander viewer, which does a lot of what 
> Batik does, plus animation.   Everything is in place for paths except 
> for arcs.  http://svgsalamader.java.dev.net.

    Good luck!

> Mark McKay
> Thomas DeWeese wrote:
>> Hi Mark,
>>    You might want to look at the Apache Batik project:
>>     http://xml.apache.org/batik
>>    It includes a class called 'ExtendedGeneralPath' that
>> wraps a standard GeneralPath and supports all of the SVG
>> draw commands.  Batik also includes a parser for the
>> path syntax which might be helpful.  In general if you want
>> to do something with SVG in Java you should look carefully
>> at Batik.
>> http://svn.apache.org/viewcvs.cgi/xmlgraphics/batik/trunk/sources/org/apache/batik/ext/awt/geom/ 
Received on Saturday, 6 August 2005 19:17:40 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:29:27 UTC