2015-08-26 12:16 GMT+02:00 Tavmjong Bah <tavmjong@...8...>:
Just to bring others up-to-date. We discussed 'stroke-alignment' yesterday at the SVG WG meeting (conveniently located in Paris). The feeling was that the initial allowed values should be 'left' and 'right' as it is easy to define how these values work for paths that contain overlapping loops. The values 'inset' and 'outset' are more complicated and require finding path intersections, something that the browsers don't need to do (yet) for any other purpose.
lib2geom can currently only find intersections between distinct paths, but adding a method to find self-intersections would be fairly easy. Arcs, line segments and quadratic Bezier curves cannot have self-intersections, so we only need to handle cubic and higher order Beziers specially, e.g. by splitting them at the roots of X derivative. The rest of the procedure would be a simple modification of the existing path-path intersection code.
Note that there are several degenerate cases, such as paths with overlapping segments, and something reasonable should be done for them as well.
Regards, Krzysztof