Re: [svg-paths] Define normalised path

On Oct 30, 2015, at 7:34 AM, Jarek Foksa <jarek@boxy-svg.com> wrote:
> The spec should be more clear what is the output of path.getPathData({normalise: true});
> 
> I would propose to define the normalized path as a path that consists from zero or more subpaths where each subpath must start with "M" segment, followed by one or more "C" or "L" segments, optionally followed by "Z" segment.


It already says this, yes?
http://www.w3.org/TR/svg-paths/#InterfaceSVGPathDataSettings
> Parameters
>  • optional SVGPathDataSettings settings
> The settings for the operation, if normalize is set to true then the returned sequence of path segments is converted to the base set of absolute commands ('M', 'L', 'C' and 'Z'), with the values adjusted accordingly.

This also matches up with the normalizedPathSegList from SVG 1.0
http://www.w3.org/TR/SVG/paths.html#__svg__SVGAnimatedPathData__normalizedPathSegList
> normalizedPathSegList (readonly SVGPathSegList)
> Provides access to the base (i.e., static) contents of the ‘d’ attribute in a form where all path data commands are expressed in terms of the following subset of SVGPathSegtypes: SVG_PATHSEG_MOVETO_ABS (M), SVG_PATHSEG_LINETO_ABS (L), SVG_PATHSEG_CURVETO_CUBIC_ABS (C) and SVG_PATHSEG_CLOSEPATH (z). Thus, if the ‘d’ attribute has an "absolute moveto (M)" and an "absolute arcto (A)" command, then pathSegList will have one SVG_PATHSEG_MOVETO_ABS entry followed by a series of SVG_PATHSEG_LINETO_ABS entries which approximate the arc. This alternate representation is available to provide a simpler interface to developers who would benefit from a more limited set of commands.
> 
> The only valid SVGPathSeg types are SVG_PATHSEG_MOVETO_ABS (M), SVG_PATHSEG_LINETO_ABS (L), SVG_PATHSEG_CURVETO_CUBIC_ABS (C) and SVG_PATHSEG_CLOSEPATH (z).

Received on Sunday, 1 November 2015 21:26:07 UTC