how to calculate line width under scale transform

Post questions on how to use or achieve an effect in Inkscape.
ts_chen
Posts: 2
Joined: Mon Mar 11, 2013 1:16 am

how to calculate line width under scale transform

Postby ts_chen » Mon Mar 11, 2013 1:29 am

This graphic is scaled 0.2 on x and 0.1 on y, the origin stroke line width is 14 . I

Open it in inkscape ,the new line width is 1.98 , who can tell me how to calculate

it please?


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
version="1.0"
width="18"
height="18"
id="symbol-playground">
<defs
id="defs4" />
<g
transform="matrix(0.2,0,0,0.1,0,0)"
id="g2168">
<path
d="M 247,532 L 280,532"
id="path2383"
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:14;stroke-

linecap:round;stroke-linejoin:miter;stroke-miterlimit:1.10000002;stroke-

dasharray:none;stroke-opacity:1" />
</g>
</svg>

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: how to calculate line width under scale transform

Postby ~suv » Mon Mar 11, 2013 6:26 pm

You need to use a current development build of inkscape to get non-uniformly scaled strokes represented geometrically precise:
ts_chen-matrix-1-in-current-trunk-r12188.png
ts_chen-matrix-1-in-current-trunk-r12188.png (82.85 KiB) Viewed 1299 times

(The next major release (0.49) will use this new renderer).

Note: the old renderer in current stable Inkscape versions (0.48.x) does apply transformations before applying the stroke, and for non-uniform transformations, the calculations for the resulting (uniformly scaled) stroke widths are not conforming to the SVG 1.1 specification.

Relevant bug report tracking issues with scaled strokes (e.g. paths inside scaled groups, or stroked shapes with preserved 'transform' attributes; fixed with the new renderer in current trunk, and more precise methods to calculate the visual bounding box of stroked objects): Bug #165715

ts_chen
Posts: 2
Joined: Mon Mar 11, 2013 1:16 am

Re: how to calculate line width under scale transform

Postby ts_chen » Mon Mar 11, 2013 11:23 pm

I want to know the correct way to calculate the line width after transform


Return to “Help with using Inkscape”