xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anjello <Anjelloa...@gmail.com>
Subject Re: CubicCurve2D in a Batik application
Date Sat, 10 Jul 2010 20:27:06 GMT

Hello Thomas,

Thank you for your reply. So, since it is unable to use the
CubicCurve2D.subdivide() to split the curve at a specified location, I wrote
my own method to split the curve by first running a path Iterator to find a
segment closest to the split point, and then using deCasteljau algorithm.
Seems to work well so far.

Thanks once again for taking time to reply me!
Anjello


thomas.deweese wrote:
> 
> Hi Anjello,
> 
> Anjello <Anjelloatoz@gmail.com> wrote on 07/07/2010 11:58:17 AM:
> 
>> I develop a java application which uses batik, and I need to split a 
> curve
>> at a specific location. What I try to do is to convert the svg into an 
> AWT
>> shape and do the splitting. It was succesful with the lines, however I 
> do
>> not understand how the offset parameters work in the CubicCurve2D 
> object. (I
>> am trying to use subdivide(double[] src, int srcoff, double[] left, int
>> leftoff, double[] right, int rightoff) method)
> 
>         Those are offsets into the src, left, and right arrays.  The 
> CubicCurve2D
> class doesn't let you split a curve at a specific location it only allows 
> you
> to subdivide a curve into two "equal" halves.  The offset parameters let 
> you
> allocate one large array and then store the subdivided cubics into that 
> array.
> 
>         You might want to look at Batik's 
> org.apache.batik.ext.awt.geom.Cubic
> class that offers a bit more flexibility in subdividing cubic curves. 
> Several
> classes in that package use the methods to subdivide cubics for the text
> wrapping code.
> 
> 

-- 
View this message in context: http://old.nabble.com/CubicCurve2D-in-a-Batik-application-tp29098061p29128080.html
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message