You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "Bishop, Michael W. CONTR J9C880" <Mi...@je.jfcom.mil> on 2006/01/11 18:57:58 UTC

Words of wisdom on Bezier curves?

Currently I'm gathering a collection of points based on the mouse
coordinates every X milliseconds.  I'd like to create a smooth Bezier
curve from the points.

 

Originally I was deriving the points using a formula I found online.
This worked well, but unfortunately it took the entire collection of
points in consideration, so the longer you drew the curve, it would
adjust all the points.

 

Now I see the path element has support for this kind of thing.  I've
constructed a path element with a number of Bezier curves; one for every
three points gathered:

 

<path M x y C x1 y1, x2 y2, x3 y3 .../>

 

This works well except the "joints" between each C segment is pretty
jarring.  It's pretty obvious where one curve ends and the next begins.

 

In short, my first solution was too smooth, my current solution isn't
quite smooth enough.  Any suggestions for getting a happy medium between
the two?  I looked at another program; InkScape, and it uses the 2nd
solution; a path with a number of C segments.  The joints between curves
are not like mine though.

 

Michael Bishop