Is there some way - a library or an algorithm - that can be used to interpolate between two instances of java.awt.Shape, or its path iterators? For example, to transition seamlessly between a rectangle and an ellipse? Or the more general case of a Path2D.
There is a class Morphing2D in the SwingX project. My preliminary testing shows, however, that it is restricted to shapes that do not contain SEG_MOVETO elements, and also that it doesn't do any fancy alignment between the two shapes, so the transition is not always ideal.
There is a software ReportMill that contains a Morphing2D. After investigation that company illegally copied the original SwingX code and pasted it into their closed source proprietary product. (An LGPL violation was filed with GNU)
I found an example for JavaFX that seems to support move-to commands. This might have been included in JFX 1.x, but seems not to be part of JFX 2.x. Internally, a translation to and from com.sun.javafx.geom.* is used which seems to be 98% compatible with standard java.awt.geom.*, so an adaptation would be easy.
Edit: My backport from JFX to Java2D works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With