W3C home > Mailing lists > Public > www-svg@w3.org > October 2010

Re: [SVGF1.12 LC] marker direction if average direction is zero?

From: Jasper van de Gronde <th.v.d.gronde@hccnet.nl>
Date: Wed, 06 Oct 2010 11:05:51 +0200
Message-ID: <4CAC3BEF.4030000@hccnet.nl>
To: Anthony Grasso <Anthony.Grasso@cisra.canon.com.au>, "Dr. Olaf Hoffmann" <Dr.O.Hoffmann@gmx.de>, "www-svg@w3.org" <www-svg@w3.org>
Note that it's not as undefined as declaring it simply "undefined" would 
suggest. Actually, with the current wording renderers would always have 
two (and ONLY two) choices, as the bisector is technically a line, 
giving rise to two possible vectors. It's just that normally it's 
obvious that the vector corresponding to the smaller angle should be 
chosen. In the case of two opposite tangent vectors it's just that there 
isn't a smaller angle.

As a tiebreaker it is possible to use the limit as t approaches zero of 
the bisector of gradient(curve1(1-t)) and gradient(curve2(t)). When 
dealing with two straight line segments (constant and opposite tangent 
vectors) their context could be used, similar to dealing with 
zero-length path segments. Failing that an artificial orientation of 
some kind would be needed to keep things consistent (I'd recommend 
specifying that if a (sub)path consists only of segments on one line the 
segments are specified in clockwise order or something like that). 
Still, in any of these cases there are only TWO possible vectors (and I 
am ashamed to say Inkscape indeed shows neither...).

So for now I would recommend making clear that implementations always 
only have two directions to consider when determining the orientation at 
a corner with two "directional" segments. And possibly the limiting 
option could be "suggested" (it shouldn't do much harm, as its basically 
just a natural extension of the definition to an otherwise ambiguous case).

BTW, it's relatively easy to use the limiting option. You can rotate the 
space so that the normalized tangent vector is (0,+-1) at the corner and 
derive a fairly simple (as in near-trivial) expression for the limit 
bisector in this orientation (if needed I can provide more details). 
Then just apply the inverse rotation to the found bisector to get the 
desired bisector. Of course this may give problems in the face of round 
off and such (although it shouldn't be much worse than with the current 
situation), but still, it's a start, and perhaps considering higher 
order derivatives could lead to an even more stable orientation 
detection than currently employed.

On 2010-10-06 07:34, Anthony Grasso wrote:
> Hi Dr. Hoffmann,
>
> Nice find! This is a very interesting case you raise. We noted this comment (ISSUE-2337 [1]) in our list of SVG Full 1.1 Last Comments to address.
>
> After discussion in our telephone conference [2], I was assigned ACTION- 2814 [3] to add wording to the specification. We decided that for this particular case in SVG Full 1.1 2nd that the behaviour is undefined. The wording has now been added and can be found in the current unpublished version of the SVG Full 1.1 2nd Edition specification [4]. We will however, look to define a behaviour for this case in SVG 2 [5].
>
> Please let the SVG Working Group know at your earliest convenience if the change satisfactory.
>
> Kind Regards,
>
> Anthony Grasso.
>
> [1] http://www.w3.org/Graphics/SVG/WG/track/issues/2337
> [2] http://www.w3.org/2010/07/06-svg-minutes.html
> [3] http://www.w3.org/Graphics/SVG/WG/track/actions/2814
> [4] http://dev.w3.org/SVG/profiles/1.1F2/master/painting.html#OrientAttribute
> [5] http://www.w3.org/Graphics/SVG/WG/track/issues/2381
>
>
>> -----Original Message-----
>> From: www-svg-request@w3.org [mailto:www-svg-request@w3.org] On
>> Behalf Of Dr. Olaf Hoffmann
>> Sent: Sunday, 23 May 2010 10:27 PM
>> To: www-svg@w3.org
>> Subject: marker direction if average direction is zero?
>>
>> Hello www-svg,
>>
>> if a path itself has a directionality at the corners/vertices, but the average is
>> zero, what is the correct behaviour?
>> See attachment for examples.
>>
>> I found a definition, if the path has no directionality, but not about the
>> problem, that the average direction can be a zero vector (the tangent
>> vectors have an opposite direction).
>>
>> Even worse, current viewers display it typically different from each other.
>> I'm not sure, what a useful behaviour could be, therefore maybe the usual
>> local x-axis should apply.
>> For the next SVG version it might be useful as well to have an additional
>> property to suppress markers for vertices with no directionality or with an
>> average resulting in a zero vector.
>>
>> Results with the usual suspects Opera, Batik/Squiggle, adobe-plugin, Gecko,
>> WebKit, Konqueror+KSVG look like random choice, result in Inkscape (0.46)
>> is completely nonsense.
>>
>> Well, even for cases with a defined direction, the results are often quite
>> different for non-trivial samples.
>> I think, currently the adobe plugin provides results almost as specified in
>> the recommendation. the Geckos quite often provide a correct result.
>> Others are more often wrong, therefore results from these viewers are
>> anyway no reliable source for a direction of a path as specified ;o)
>>
>>
>> Olaf
> The information contained in this email message and any attachments may be confidential and may also be the subject to legal professional privilege. If you are not the intended recipient, any use, interference with, disclosure or copying of this material is unauthorised and prohibited. If you have received this email in error, please immediately advise the sender by return email and delete the information from your system.
>
>
Received on Wednesday, 6 October 2010 09:06:53 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:46 GMT