• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Maintain Stroke Width When Scaling

Explorer ,
Oct 25, 2020 Oct 25, 2020

Copy link to clipboard

Copied

Hi. I'm trying to maintain stroke width when scaling a shape, and I use the expression below (added to the "Stroke Width" property). It works when scaling with both axis constrained. However, if I scale the axis separately, the expression doesn't work anymore. Is there something I can add to it so that the stroke thickness remains the same when scaling them independently?

value*(100/transform.scale[0])

 

Thanks

TOPICS
Expressions

Views

8.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 25, 2020 Oct 25, 2020

Copy link to clipboard

Copied

The easiest way to maintain a stroke width when scaling a shape layer is to move the stroke below Transform Shape and then use the Transform Shape/Scale instead of layer scale. 

Screenshot_2020-10-25 12.52.05_pCninG.png

 

You can't maintain a constant stroke width if you scale the layer using different X and Y values because there is no way to know which part of the stroke needs to be adjusted or tapered. The best you could do is average the scale values and divide the original stroke width by the scale factor like this:

sv = transform.scale;
avScale = (sv[0] + sv[1])/2;
sFactor = avScale * .01;
value / sFactor

That will give you this when the X scale value is 50 and the Y is 100:

Screenshot_2020-10-25 13.01.09_QoTOVy.png

Changing only the Y scale value will maintain the thickness of the vertical part of the stroke, but the horizontal part of the stroke is going to change with the layer scale.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 18, 2022 Oct 18, 2022

Copy link to clipboard

Copied

LATEST

Not sure if you still need a solution to this but in some situations you can put the object in a new shape layer group and add a merge paths, then adjust the scale in the in the original shape layer group.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines