Inkscape.org
Beyond the Basics Logarithmic spiral with CSS
  1. #1
    Bzz Bzz @Bzz

    Hi,

    When I style a logarithmic spiral with a class (defined in the "Selectors and CSS" it behaves weird.

    I defined a class with only one property stroke-width. When I assigned a class to different spirals, the stroke width depends on the size of a spiral. Bigger (same shape, called up) spiral is thicker, smaller spiral is thinner. When the stroke width is set Fill ans Stroke | Stroke style, the width works properly, it is exactly as set.

    How can I set the spiral stroke width with a class?

    Wojtek

  2. #2
    Bzz Bzz @Bzz

    Example file showing the effect

    Css Spiral
  3. #3
    Aero Aero @Aero◻️

    Maybe this?

     

    Vector Effect
  4. #4
    Bzz Bzz @Bzz

    Thank you. Works.

  5. #5
    Bzz Bzz @Bzz

    Unfortunately works only on a screen. The spiral is displayed with the same size but actual stroke width is different and when printed the size is different.

  6. #6
    Aero Aero @Aero◻️

    Works here when svg is saved as pdf from Firefox.

  7. #7
    Bzz Bzz @Bzz

    I printed mine from Inkscape to a pdf printer. If saved from Inkscape to pdf (Save as ...), the spirals also have different thickness.

    I guess there is something about "transform" generated by Inkscape when a spiral is created.

  8. #8
    aperitero aperitero @aperitero

    I don't know about the CSS property "vector-effect: non-scaling-stroke" and how well Inkscape handles it.

    So about your original example: when you scale down the spiral, Inkscape keeps the original spiral and creates a transformation matrix for it. The stroke width also gets scaled down since it's set from the CSS class (which Inkscape wouldn't try to change in order to compensate for the transformation like it normally does when it is set from the "stroke style" panel).

    I see two workarounds:
      - scale down the spiral using the spiral tool: (ctrl +) shift + drag the external handle of the spiral to scale it up/down.
      - apply the transform: select the scaled down spiral, then "extensions > Modify Path > Apply Transform". Doing so however, the spiral will be transformed into a path (it won't be a spiral anymore).