xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: CubicCurve2D in a Batik application
Date Thu, 08 Jul 2010 10:06:36 GMT
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.

Mime
View raw message