Re: fancy lines

Hello,

in previous discussions about implementations and underlying libraries
it turned out, that stroke-dasharray is only defined in SVG to be a pattern
along the stroke, but unfortunately it is not implemented as such a pattern,
just something like subpaths, what restricts the usability of stroke-dasharray
dramatically and increases the number or reasons for bugs and annoying
behaviour in viewers. And there are more problems with stroke-dasharray,
if one has corners and spikes in the path or more than one subpath.
Therefore in practice stroke-dasharray today is only for very basic use
cases, if one does not care about details.

On the other hand, if you apply a pattern defined by a pattern element
to a stroke, it works in the same way as for fill - therefore the pattern
is not warped along the pace of the stroke - if you assumed this - it has
the same alignment as for a filled area.
Example with pattern for fill and stroke:
http://upload.wikimedia.org/wikibooks/de/1/13/SVGpattern01.svg


If you need only a fragment of the stroke perpendicular to the pace
of the stroke, you can get arbitrary fragments using clipping and masking,
using the same path data (or the inverse path data, switching
inside/outside) with different stroke-width as mask or clip-path.


Maybe in the future, new marker features from the SVG2 draft 
may provide more useful methods to get some pattern along the
stroke:
http://www.w3.org/TR/SVG2/painting.html#RepeatingMarkers




Olaf

Received on Saturday, 5 January 2013 18:16:19 UTC