
So you would have to approximate it one way or the other. The "simplest" case would be if you only have non-self-intersecting polylines, polygons or paths that don't contain curves because in general, you can't draw exact "parallel" Bézier curves to the right and the left of a non-trivial Bézier curve that would delimit the stroked area - it's mathematically non-existent. I just tried Path => Outline stroke in Inkscape (I think that's what the English captions should say), and what came out didn't really look the same as the stroked path. And even Inkscape doesn't really do a good job. If you look at what Ghostscript spits out when you run the code I posted at the linked question, it's pretty ugly. As mentioned in my answer to the linked question, PostScript has a command for generating paths that produce basically the same output as a stroke, called strokepath. There has been a similar question recently:Īll in all, this is a non-trivial task. To put it another way, what does the browser do when you tell it to stroke a path – how does it work out what shape the stroke should be? Or, even better: if someone could explain to me the geometry theory about how I would do this task manually, by taking the list of line coordinates I have and working out a new path that effectively 'strokes' it, that would be amazing. Does anyone know of a library/function that would do this? I can't find any function that does this – I've looked through the docs of D3.js and Raphaël, but no luck. So I'm trying to manually 'thicken' a line into a solid shape. but I'm trying to get a filled shape rather than a stroked line, so that I can do further modifications on it, such as warping it, so the resulting 'stroke' might vary in thickness or have custom bits cut out of it (neither of these things are possible with a real SVG stroke, as far as I can tell).

I can render this line as a path, and give it a stroke of a certain thickness. The line is just a simple curved line, a sequence of coordinates.


I want to convert a stroked path to a filled object.
