0
\$\begingroup\$

I need to parse a SVG path expression like

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

and have a way of iterating 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.

\$\endgroup\$
2
\$\begingroup\$

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

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.