xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Neumann <neum...@karto.baug.ethz.ch>
Subject Re: get x and y values of a path element
Date Tue, 06 Mar 2007 13:31:20 GMT
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,

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,
>To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
>For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org

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: neumann@karto.baug.ethz.ch
www: http://www.carto.net/neumann/
SVG.Open: http://www.svgopen.org/
Carto.net: http://www.carto.net/

To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org

View raw message