3 ms·
You could create stroke-width-ratios by applying SVG transformations to each path element, or groups of it. Then you have to compensate for the introduced tran
by mxfh 10y ago
You could create stroke-width-ratios by applying SVG transformations to each path element, or groups of it.
Then you have to compensate for the introduced transformation in the stroke path geometry itself.
Example: http://codepen.io/mxfh/pen/RopMvr http://codepen.io/mxfh/pen/RopMvr
Kind of hacky, but this could be automated by evaluating the stroke transforms and applying the reverse transforms to source path geometry for compensation.
- amelius 10y agoWow, looks useful! I didn't realize that it could actually be that simple :) But of course applying the inverse transform to arbitrary paths could still be a tricky mathematical operation.
- jacobolus 10y agoIf you’re willing to use the canvas instead of SVG, it’s even easier. You can draw the path in one coordinate system, then change the coordinate system for the action of stroking the path, which will not change the location of the path on screen but will let you effectively make the stroke into an arbitrary ellipse.