Hi all.
I am investigating the problem of solving jigsaw puzzles.
So, to start, I need to generate jigsaw puzzles. I found the
article "Generating SVG Jigsaw Puzzles" and am currently using
the given code to generate puzzles and their pieces. The given
code is written in javascript. The article located at
https://dev.inventables.com/2016/02/26/generating-svg-jigsaw-puzzles.html
and is well written, ad-free, and contains all source code.
My first instinct was to translate the code to Java, but was
stopped almost immediately for the lack of a curve generating
function that is supplied in the javascript library D3.js used
in the article, but not in java.awt.geom. The author describes
this curve as a "B-spline, with control point duplication on the ends".
The article contains a nice interactive demo of the curve.
So my workflow at present is generate the puzzle pieces using
the given javascript, output SVG, use the Java Batik library
to convert the SVG to java.awt.geom.Path2d objects. Messy.
The paths produced by this contain five CubicCurve2d segments
and determining the needed parameters is considerably more complex.
I haven't been able to easily and reliably duplicate the
functionality in Java.
My math skills are not up to the task of understanding splines
so searching the web produces mostly content that I am not able
to consume. Adding Java to the search terms hasn't been much help.
I am hoping that someone will take the interest to glance at the
article and be able to some suggest some available Java functionality
to replace the D3.js functionality.
Thanks much in advance.
Jeff Higgins
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)