W3C home > Mailing lists > Public > www-svg@w3.org > February 2014

Re: Bearing path command

From: Paul LeBeau <paul.lebeau@gmail.com>
Date: Thu, 13 Feb 2014 22:22:48 +1300
Message-ID: <CACfsppCux=9iawpRStuFFiA28isPAiOQ2bUH8PziG7oidt8mYQ@mail.gmail.com>
To: Cameron McCormack <cam@mcc.id.au>
Cc: www-svg <www-svg@w3.org>
Hi Cameron

> In the section of each command it describes what effect the current
bearing has.

Ah. Thanks. Didn't see that.

In the definition of 'h' you say:

> When a relative *h* command is used, the end point of the line is (cpx + x
 cos cb, cpy + x sin cb).

Given that the cpx,cpy moves, I assume that means that you can use "b 90 h
10 10 10 z" to draw a square?

>Although multiple parameters may be specified, this usually will not be
useful, as they could be combined into a single angle value.

I'm not sure about the clarity of this statement.  For example, does the
following draw a pentagon or not?

  "b 36 36 h 47 47 47 47 z"

And is the following equivalent to your pentagon example or not?

  "M 150,10 b -36 72 h 47 47 47 47 z"


On 13 February 2014 18:07, Cameron McCormack <cam@mcc.id.au> wrote:

> Hi Paul,
> Paul LeBeau wrote:
>> I was just looking at the latest draft and noticed the inclusion of the
>> new B/b bearing path command.  This is the first time I've seen this new
>> feature, so apologies if this has been discussed before.
> This is the first WD it's appeared in.
>  I think this section may need a little expansion, as it raised some
>> questions for me about implementation.
>> 1. The first line says it "influences the orientation of subsequent
>> relative path commands".  Does that mean that it, in effect, rotates the
>> axes for subsequent (relative) path commands?  The only example provided
>> used 'h' commands.  What effect does it have on other commands?
> In the section of each command it describes what effect the current
> bearing has.  For example see below the table in
> https://svgwg.org/svg2-draft/paths.html#PathDataLinetoCommands for what a
> relative lineto command means in terms of the current point and current
> bearing.
>  2. What happens if there is an absolute command next, or after that?
>>   Does it reset the bearing?  Does subsequent mean all subsequent
>> relative commands of just the consecutive ones after the bearing command?
> No, the only commands that influence the current bearing are "B" and "b".
>  If you have a sequence of segments "M, B, l, L, l" then the current
> bearing will be the same value for all three lineto commands, and it will
> affect both of the relative linetos.
>  3. If an absolute command doesn't reset the bearing, is there anything
>> that does?
> Just "B" and "b".
>  4. Does the bearing have any effect on the orientation of markers?
> That wasn't my intention but it's a good question.  I think vertex markers
> shouldn't be rendered on each B/b command.  So for something like "M
> 100,100 B 45 h 100 b 90 h 100 b 90 h 100" you would still only get three
> vertex markers, and they would be at the same orientation as if you'd
> written the path string using only absolute path commands and without the
> bearing commands.
Received on Thursday, 13 February 2014 09:23:36 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:47:35 UTC