yes, there is the method ".getPointAtLength(distance)" at the interface "SVGPathElement", see also IDL of the SVG 1.1 spec. This is implemented in all important SVG viewers incl. Batik. See spec: http://www.w3.org/TR/SVG11/paths.html#DOMInterfaces - there is also the method .getTotalLength() which returns the path length which you can use in .getPointAtLength()

However, if you just want to move an element along the path, consider using SMIL: http://www.w3.org/TR/SVG11/animate.html#AnimateMotionElement - this is implemented in the SVN version of Batik only, not in the latest stable release. However, a new stable release will probably happen soon.

Hope this helps,
Andreas

Hauke Fuhrmann wrote:

Hello there,

is there any possibility to get a list of interpolation points of an
arbitrary SVG Path element?

My task is to move some element along an SVG Path element and therefore
I want to redraw it again and again at the corresponding positions of
the path. Therefore I need the x and y coordinates of the path according
to some input parameter, which could be the percentage of the path
length. E.g. something like

Point getCoords(float percentage);

All methods or classes I found return only --for example-- an array of
the _commands_ rather than actual positions, e.g. the PathArrayProducer.
I hope I can avoid to write my own PathHandler, that interpretes the
path commands.

Best regards,
Hauke

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
----------------------------------------------
Andreas Neumann
Institute of Cartography
ETH Zurich
Wolfgang-Paulistrasse 15
CH-8093  Zurich, Switzerland

Phone: ++41-44-633 3031, Fax: ++41-44-633 1153
e-mail: [EMAIL PROTECTED]
www: http://www.carto.net/neumann/
SVG.Open: http://www.svgopen.org/
Carto.net: http://www.carto.net/


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to