I set bezier mode to true and got the exception `IndexOutOfBoundsException: Index: 1, Size: 0`

so I could not try that out.

Since you have the coordinates of the curve you want to represent you could use these to perform a Bezier curve fitting - see the Pomax (curve fitting) guide.

I am not sure when I will be releasing my Bezier library, the actual Bezier class is virtually complete and implements most of the functionality in Pomax guide but I still have a lot to do before release.

Most graphics applications use cubic or quadratic beziers but I have written the library to handle curves of any order >= 2 (i.e. degree >=1). So we have

Degree Shape Order (= number of control points) 1 straight line 2 2 quadratic bezier 3 3 cubic bezier 4 4 quartic bezier 5 and so on

This means I have not implemented any functionality from the guide that is specific to a particulare order e.g. cubic.

Some of the functionality, especially for higher order curves uses matrix maths and I use EJML (Efficient Java Matrix Library) for its ease of use. This does mean that my library is for JavaMode and would need a lot of work to convert it to JS