The most complex shape, supported by Java2D API is a Bezier segment. Suppose I want to draw rational segment (each control point has a weight and the entire rendering formula is slightly different).
How to accomplish that?
Is it possible to extend rendering engine to be able to draw more complex shapes?
UPDATE
Usual way to implement custom shape is implementing Shape
interface. This interface has key methods to return PathIterator
while PathIterator
iterates over segment types. There are only 5 segment types. The most curved of them is SEG_CUBICTO
which is standard Bezier curve with 4 control points (including 2 for beginning and end).
If I apply linear fractional transform to bezier curve, each control point get a weight, as an addition to it's coordinates, and Bezier curve turns to NURBS (not sure about that, have failed to learn exact terminology). Anyway, the formula for curve differs from Bezier.