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

Re: rotated path segment proposal

From: Cameron McCormack <cam@mcc.id.au>
Date: Mon, 25 Jul 2011 10:13:28 +1200
Message-ID: <4E2C9908.9040502@mcc.id.au>
To: Dirk Schulze <dirk@dschulze.com>
CC: public-svg-wg@w3.org
On 24/07/11 6:03 PM, Dirk Schulze wrote:
> just some questions for clarification. First: If an author sets a
> rotation it is used for every following f/F? Does the rotation level
> always rely to the current userspace of the path? Means independent
> of the current 'direction' of the path?

The R/r command would just adjust the rotation at that point in the 
path.  After an F/f, the rotation would be parallel to that straight 
line segment, so that means the current rotation would be the same.  The 
rotation is just in the userspace of the path, yes, so

   <svg ...>
     <g transform="rotate(45)">
       <path d="M100,100 r-45 f100"/>
     </g>
   </svg>

would look like a horizontal line on the screen.

> If we take the userspace for rotation and not the current direction
> and the last set rotation value is used, this would give us a
> straight diagonal line:
>
> M0,100 r-45 f70.71 f70.71

I'm not sure what you mean exactly, but my intention was for that path 
to result in a straight diagonal line.

> If we would take the current direction of the path, the path
> direction was rotated by 45 degree and we have to rotate it a second
> time on the second f-segment . This would lead to a vertical line for
> the last segment.

No second rotation.

> The reason why I ask this is, that the idea of 'rotation' and
> 'forward' reminds me to turtle graphic. And I guess a lot of
> developers remember this simple programming language, since it is
> used on many schools to get a feeling for programming. And turtle
> graphic takes the current direction of the path. But turtle graphic
> just uses forward and backward and no arcs or curves like we have for
> SVG Path. Thats means it is possible to interpret the behavior with:
> store last set rotation level and take this for the direction of the
> next segment in userspace (first interpretation on the top of this
> mail). The only hint that the turtle takes the current direction of
> the path and does not rely to the userspace is, that the turtle gets
> rotated itself too.
>
> But it could be difficult to get the current direction of a path
> after applying a curve or arc. The same for M0,0 L0,0. So using the
> rotation to the basis of the userspace might make most sense. At
> least it is easier to implement.

I don't follow why it would be difficult to get the current direction of 
the path for curves and arcs -- we need to know the direction so that 
markers can be oriented correctly, etc.  Whatever the current rules are 
for determining path direction would be used for tricky cases like "M0,0 
L0,0" too.
Received on Sunday, 24 July 2011 22:14:07 UTC

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