- From: Tavmjong Bah <tav.w3c@gmail.com>
- Date: Fri, 17 Apr 2015 13:51:36 +0200
- To: Amelia Bellamy-Royds <amelia.bellamy.royds@gmail.com>
- Cc: www-svg <www-svg@w3.org>, "Smailus, Thomas O" <Thomas.O.Smailus@boeing.com>
On Thu, 2015-04-16 at 18:35 -0600, Amelia Bellamy-Royds wrote: > To focus on the core issue (and not the specific example Thomas > provided), the question really comes down to: > > > Can we make it possible in SVG to create stroke effects that apply to > only certain segments in a complex shape? > > > In CGM, as I understand it, this particular on/off stroking effect is > included within the basic path geometry instructions. However, there > are many more general cases as well. In data viz/d3, we often get > people asking if it is possible to color one section of a > polyline-type path differently than the others. > > > The solution that currently exists is the same solution that Thomas is > using for his CGM conversions: create two (or more) paths, one to draw > the fill, and the other(s) to draw the line segments. But as Thomas > pointed out, that loses the "connectedness" of the strokes, which can > have effects e.g. in linejoins. > I'm somewhat concerned about the idea of mixing stroking instructions > in with path data because it muddles up geometry and painting styles. Definitely agree here. > In my mind, the best approach--in the sense of most > generalizable--would be to use the "superpath" idea, where you could > construct a single filled shape as the concatenation of multiple > segments. Fill styles would apply to the entire shape, but stroke > styles (including stroke: none) could apply to subpaths. (We'd > probably be able to poach a lot of the CSS border style rules for > defining how to connect two stroke segments with different styles.) This is exactly what I was thinking. We decided, though, that a path chunk can only be interpreted as part of an entire path.[1] This is important for interpreting relative path data but maybe we could relax it for styling. I'm not sure, though, that we can poach much from CSS border style rules as that appears to only deal with rounded corners of rectangles.[3] > I confess I haven't had a chance to look through the various proposals > for superpath-type elements carefully, so I don't know if any of them > currently include the option of styling the strokes on subpaths > individually. But, I don't expect that it would be a major conflict > to try to integrate the idea. After all, since stroke styles are > inherited, you would always be able to stroke the entire superpath > shape as normal just by setting the stroke styles on it and not on the > subpaths. Here's the trial SuperPath implementation:[4]. Tav [1] http://www.w3.org/2014/08/26-svg-minutes.html#item01 [2] http://www.w3.org/2015/02/12-svg-minutes.html#item01 [3] http://www.w3.org/TR/css3-background/#corner-shaping [4] https://github.com/moissinac/SuperPath/wiki/In-progress-new-implementation-of-SuperPath
Received on Friday, 17 April 2015 11:52:06 UTC