Re: [svgwg] Add a method to return the path direction (tangent) angle at a given distance

Good points.  To mimic vertex markers correctly (other than start and end markers) you would need additional methods:

a. get the length of individual path segments and/or the total length of a path up to the start/end of a particular segment
b. get the incoming/outgoing angle for a particular segment vertex, which is different from the [path directionality](https://svgwg.org/svg2-draft/paths.html#PathDirectionality) at that point.

So all that would be considerably more complicated.  But I still think there is a use for the basic tangent-angle method, as an SVG DOM interface to the types of calculations that are done under the hood for `offset-rotate`.

The additional methods could still be useful as part of the API in [SVG Paths](https://svgwg.org/specs/paths/#DOMInterfaces) (which need to be updated so that the "path" methods extend from SVGGeometryElement, not SVGPathElement).

_____________________________________

BTW, in SVG 2, the _directionality_ of the path at a vertex is separate from the marker orientation, and is defined as:

> Otherwise, if the given distance along the path occurs at a path segment boundary, then the direction of the path is the direction at the start of the segment at the given distance, considering each segment to be endpoint exclusive.
>
>This will "move past" zero length segments, and choose the later segment if the distance is at the boundary between two non-zero length segments.

Which is the opposite of what's currently written in CSS motion path:

> If the offset path is composed of multiple line segments, the orientation at the connection between the segments is the same as the direction of the previous segment.

One or the other should be changed to be consistent.

-- 
GitHub Notification of comment by AmeliaBR
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/338#issuecomment-318838557 using your GitHub account

Received on Saturday, 29 July 2017 15:32:41 UTC