Inkscape.org
Beginners' Questions stroke scaling issues
  1. #1
    arielle arielle @arielleishere

    I'm on Mac, with Inkscape 1.3.2.

    This feels like a pretty basic thing, but as far as I'm aware, I have it set the way I want and it's still messing up? I almost always want my lines to stay at 0.25mm thickness, since that's the kerf of my laser. I have the scale stroke option turned off, but it's doing this weird thing where it's treating my strokes as if they're outlined objects, but they're not.

    So for example, here is a rectangle that I increased the width of -- it made the vertical lines super thick while keeping the horizontal ones correct. But according to the stroke style toolbar, it's still 0.25mm. Here are a couple screenshots showing what it's doing. Any ideas??

    Screenshot 2024 08 16 At 1.23.15 Pm
    Screenshot 2024 08 16 At 1.18.15 Pm
    Screenshot 2024 08 16 At 1.21.51 Pm
    Screenshot 2024 08 16 At 1.21.46 Pm
    Screenshot 2024 08 16 At 1.17.53 Pm
  2. #2
    Polygon Polygon @Polygon🌶

    Seems you´re scaling a group instead of its content.

  3. #3
    arielle arielle @arielleishere
    *

    There's no group, only the one single rectangle.

    Screenshot 2024 08 16 At 1.42.44 Pm
  4. #4
    COD COD @COD
    *

    Following

    Inkscape v1.3.2 Windows 11

  5. #5
    COD COD @COD

    OK - I have my transforms set to preserved normally. If set to Optimized, the lines doesn't distort.

     

  6. #6
    arielle arielle @arielleishere

    I could have sworn that I had mine set like that originally, and the last time I looked for advice, I was told the opposite! But you're right, this does seem to work for now! Thanks!

  7. #7
    COD COD @COD

    @arielleishere

    I honestly didn't know this as well. For my particular use of Inkscape - I keep mine at preserved. That would cause issues if you do a stroke to path. Vertical lines would be wrong. 

    I don't know if this is intended behavior or a bug. I drew two different squares. One preserved. One optimzed. Rescaled them. Looked at the XML path data and in both cases, the stroke width was also changed on both. In the preserved, radical change. In the optimized it was minor (going from 2.0 to 1.999). If using optimized, rescaling should not cause a style change. !?!???!

     

  8. #8
    COD COD @COD

    Filed a bug report: https://gitlab.com/inkscape/inbox/-/issues/10896

    I checked this in v1.2, v1.3.2 and v1.4beta 2. Same behavior. Have no clue if this is a bug or not. 

  9. #9
    COD COD @COD

    Did a little research using AI:

    Yes, the SVG transformation matrix does apply to stroke width. When you apply transformations like scaling, rotating, or translating to an SVG element, it affects both the path coordinates and the stroke width. This means that if you scale an element, the stroke width will also be scaled accordingly.

    However, if you want to prevent the stroke width from being affected by transformations, you can use the vector-effect="non-scaling-stroke" attribute. This ensures that the stroke width remains constant regardless of any transformations applied to the element.

    Here’s an example:

    XML

    rect x="10" y="10" width="100" height="100" stroke="blue" fill="none" stroke-width="2" vector-effect="non-scaling-stroke" transform="scale(2)"

    In this example, the rectangle will be scaled, but the stroke width will remain at 2 units.