Inkscape.org
Beyond the Basics How is the final stroke-width calculated within groups?
  1. #1
    svenhb svenhb @svenhb

    I couldn't find any information how the stroke-width is transformed...
    Up to know I thought the final stroke-width is calculated using the scalings of all groups and the path - see the svg code below:
    1) scaling of 'g0001' * scaling of 'path0011'  * stroke-width  * dpi = 1 * 1 * 0.0002604in * 96 = 0.025 mm -> confirmed by incscape
    2) scaling of 'g0002' * scaling of 'g0012' * scaling of 'path0112'  * stroke-width  * dpi = 0 * 1 * 0.00344 * 0.22213928in * 96 = 0 ??? But incscape shows 0.025 mm
       If I leave out the '0' from the matrix in 'g0002': 1 * 0.00344 * 0.22213928in * 96 = 0.073359

    Does anyone knows, how the stroke-width transform works?

    The code:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!-- Created with Inkscape (http://www.inkscape.org/) -->

    <svg
       width="22.535355mm"
       height="24.070175mm"
       viewBox="0 0 22.535355 24.070175"
       version="1.1"
       id="svg821"
       sodipodi:docname="test.svg"
       inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
       xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
       xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:svg="http://www.w3.org/2000/svg"
       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
       xmlns:cc="http://creativecommons.org/ns#"
       xmlns:dc="http://purl.org/dc/elements/1.1/">
      <g
         transform="translate(2.4999999,-272.96518)"
         id="layer1"
         inkscape:groupmode="layer"
         inkscape:label="1">
        <g
           transform="translate(3.7163734,0.02505583)"
           id="g0001">
          <path
             inkscape:connector-curvature="0"
             d="m -4.9547318,288.6345 -0.036035,-0.0726 -0.1104309,-0.11122 h 0.7695287"
             style="fill:none;stroke:#000000;stroke-width:0.0002604in;stroke-linecap:round;stroke-linejoin:round"
             id="path0011" />
        </g>
        <g
           id="g0002"
           transform="matrix(0,-0.34364983,0.33801784,0,-95.940701,281.19026)"
           style="fill:none;stroke:#000000;stroke-width:2.93408108;stroke-linecap:round;stroke-linejoin:round"
           inkscape:label="Hershey Text">
          <g
             id="g0012"
             transform="translate(-6.9999995,279)"
             style="stroke-width:2.93408108">
            <path
               id="path0112"
               transform="scale(0.00344,-0.00344)"
               style="stroke-width:0.22213928in"
               d="m 220,504 v 32 l 32,62 32,32 62,32 h 126 l 64,-32 31,-32 31,-62 V 472 L 567,410 504,315 189,0 h 441"
               inkscape:connector-curvature="0" />
          </g>
        </g>
      </g>
    </svg>

     

    Test
Inkscape Inkscape.org Inkscape Forum Beyond the Basics How is the final stroke-width calculated within groups?