1

I'm looking for a library that can parse a SVG path expression like

m8,295c-4,-292 441,-291 446,-26c5,265 440,263 442,-9

and have a way of interpolate over it in [0 ... 1]. I looked into Apache Batik but it doesn't seem to have this specified function. I also looked at Salamander SVG but in the end the path is a wrapper around java.awt.geometry, which is not ported to android so I can't really use it.

ibrabeicker
  • 1,786
  • 2
  • 19
  • 31
  • Have you looked at this thread? http://stackoverflow.com/questions/4517388/svg-processing-under-java-on-android-and-desktop?lq=1 – mttdbrd Apr 28 '14 at 23:02
  • The SVG DOM has routines for getting the coordinates of point x along the path. But you would need to use a WebView to get access to those functions. There are a few other more lightweight SVG rendering libraries for Android, but none of them give you DOM access. – Paul LeBeau Apr 29 '14 at 04:37

1 Answers1

2

I hammered together the class that I needed using the AnimateMotion classes from Batik to interpolate through the path, it has no dependency with AWT or android. If anyone wants to use it it's in the following repository. The only dependency is libgdx Vector2 that can be easily replaced by any other 2 point class

http://github.com/ibrabeicker/bezier

ibrabeicker
  • 1,786
  • 2
  • 19
  • 31