API for Retrieving Stroke Outline?

One feature I occasionally need with visualization is to create a
polyline with variable line width and stroke color. Since this can't
(currently) be done with a single polyline or path element, I
implemented miter joins in Protovis, allowing me to render each
segment of the polyline as a distinct path element:

  http://mbostock.github.com/protovis/ex/segmented.html

Another, more practical, example:

  http://en.wikipedia.org/wiki/File:Minard.png

I didn't implement all the other joins (or even miter limits), since
it's a lot of work. A new feature that could make this much easier,
and also potentially allow a lot of creative manipulation via
JavaScript, would be an interface for retrieving the vector outline of
a stroked path. In this example, I could create separate stroked paths
for each segment, pull out the coordinates and then create filled
paths.

We've already been discussing a text-to-path API [1]. How about a
stroke-to-path API?

Mike

[1] http://www.w3.org/Graphics/SVG/WG/wiki/Proposals/Text_to_path_API

Received on Thursday, 10 November 2011 16:40:14 UTC