[OpenJDK 2D-Dev] X11 uniform scaled wide lines and dashed lines; STROKE_CONTROL in Pisces

Denis Lila dlila at redhat.com
Tue Aug 24 10:26:49 UTC 2010


Hello again.

> It would be great if anyone has any better ideas for how to go about this.
> To me it seems like the problem is that in the webrev I chop up the curve to be
> interpolated at equal intervals of the parameter.

I implemented another version that detects where either dx/dt or dy/dt is 0, and
splits the curve there. This works pretty well for all the curves I've tested 
(except ones containing "cusps", or something close to a cusp, like p.moveTo(0,0);
p.curveTo(100,100,0,100,100,0);). Best of all, this:

> For example, the curve p.moveTo(0,0),p.curveTo(84.0, 62.0, 32.0, 34.0, 28.0, 5.0)

is no longer a problem.

There is another problem with this method (other than the cusps, which can probably
be handled easily as a special case): it is axis-dependent. Ideally, it shouldn't be
because the optimal subdivisions of a curve are at values of t that do not change
under rotations and translations, but with this method, the t values at which I split
the curve do change.

A better way would take into account curve flatness instead of changes in x or y
direction.

Thanks,
Denis.




More information about the 2d-dev mailing list