W3C home > Mailing lists > Public > public-svg-wg@w3.org > July to September 2009

ISSUE-2288 (path-rotate-command): Consider adding rotate and move-forward path commands [SVG Core 2.0]

From: SVG Working Group Issue Tracker <sysbot+tracker@w3.org>
Date: Wed, 1 Jul 2009 06:07:12 +0000 (GMT)
To: public-svg-wg@w3.org
Message-Id: <20090701060712.707C16B64C@tibor.w3.org>

ISSUE-2288 (path-rotate-command): Consider adding rotate and move-forward path commands [SVG Core 2.0]


Raised by: Cameron McCormack
On product: SVG Core 2.0

Certain kinds of paths are difficult to write and similarly difficult to animate.  One example is creating a path like this:


where the two path segments are of length 50, say, and the angle between them is 45 degrees.  Currently you need to use trig to work out the end point of the second path segment.  It would be handy if there were path data commands that let you specify this easily:

  <path d="M100,100 h50 r45 f50"/>

Here, 'r' means rotate and 'f' means 'move forward'.  For commands other than 'r', there will be a current angle/tangent to the path.  The 'r' command just sets this.  The 'f' command draws a straight line in the direction of the current angle.

Animating such a path to change the angle is also quite difficult, and normally requires decomposition into many animation steps.  With 'r' and 'f', this becomes easy:

  <path d="M100,100 h50 r45 f50">
    <animate attributeName="d" values="M100,100 h50 r45 f50;
                                       M100,100 h50 r135 f50;
                                       M100,100 h50 r45 f50"
             dur="2s" repeatCount="10"/>

This came out of some discussion Doug and I had about performing animation on a human-like figure (moving his arms).
Received on Wednesday, 1 July 2009 06:13:43 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:20:11 UTC