Mobile app version of vmapp.org
Login or Join
Samaraweera207

: Inkscape stroke to path width changing on rounded polygons When I create a rounded polgon and elongate it, when I try to export it as a pdf, the thickness of the line changes (thicker in

@Samaraweera207

Posted in: #Export #Inkscape #Path #Vector

When I create a rounded polgon and elongate it, when I try to export it as a pdf, the thickness of the line changes (thicker in the elongated axis). So I tried object to path and stroke to path, but this causes the same problem. However, this does not happen when exporting as a png.



Any ideas on how to convert to paths without the line thickness changing?

Thanks

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Samaraweera207

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sarah814

UPDATE: With the additional details you provided in the comments I believe I better understood your question, so let me provide an update. The answer below is still valid - if you transform the object as a whole, you distort the stroke. If you don't, you don't. Exporting the shape to a PDF or a PNG should not affect the stroke at all (see below).

I initially mistook your image for a rounded rectangle, sorry about that. To better highlight that we're dealing with a rounded polygon, I'm using a polygon with only 3 corners and roundness 0.2 in the following.




Any ideas on how to convert to paths without the line thickness changing?


Yes. Basically, there are two cases you might be interested in:

1. Scale the shape but keep its aspect ratio without changing the stroke width


Simply double click the object (as explained below), then use the object handles. For a polygon the handle will look like this:





After you drag the handle to change the size of the shape, your object will still have the same stroke width.


2. Distort the shape (do not keep its aspect ratio) without changing the stroke width

I believe this is the case you asked for in your example ("obtain an object elongated along the x-axis). To achieve this effect:


Convert the object to a path.
Move the individual vertices along the x-axis until you have elongated the object to your liking.




If you need a hint where to place the vertices, you could move a distorted duplicate with uneven stroke and the exact desired width above and use guides to place your vertices, like so:



Now you have an elongated shape for which you can still edit the (uniform) stroke width.

Some Remarks


The button "Scale stroke width by the same proportion" will only work for uniform scaling. That means if you scale the object by different amounts in the x and y dimensions, the stroke will be distorted. This is because the affine object transformation is applied at the end (after the shape has been drawn with stroke).
If you stretch the object width, and then convert the object to a path, the (uneven) stroke is converted to a path and you won't be able to edit its width anymore.
The stroke of the object does definitely not change when you export it. You can find the exported PDF with the four shapes shown above here. All shapes are as they should be. Same for the PNG. If the stroke seemed uniform in your PNG, maybe the export resolution wasn't sufficient? (Just an assumption)


I hope that answers your question.



ORIGINAL ANSWER

First off: I am assuming that by "rounded polygon" you mean a "rounded rectangle". The effect you're observing is perfectly normal, since you're applying a scaling transformation to the entire object, which will distort/scale the object, including its stroke.

The Problem

Generally, you will distort/scale an object if you drag its bounding box or edit its width and height in the object properties field. In this case, Inkscape doesn't care whether it's an object with a stroke, an image, a group of objects, a complex polygon etc. It simply applies an affine transformation to the object.

For example, create a 100x100 pixel rectangle with a 10 pixel border and a 20 pixel corner radius. Then select the object and change its width to 210 pixels. This is what you will get:



The Solution


Any ideas on how to convert to paths without the line thickness changing?


To scale the object without affecting its stroke, you need to enter "Edit" mode. Then you can drag the handle of the specific object (polygon, star, rectangle, circle etc.) or change the object properties (like width and height) in the appropriate fields. To enter "Edit" mode, double click the object. Inkscape will now be aware of the type of object you're editing and offer you specific fields to change the object properties. In case of a rounded rectangle this will be the width and height of the rectangle, as well as the x and y corner radii. For a star this would be the number of corners, the spoke ratio etc.

If, after double-clicking, you enter 210 pixels in the width field or drag the top-left / bottom-right handle accordingly, you get the desired result (an elongated rectangle with a proper stroke). Note that there are additional handles to change the corner radius interactively.



Important: When you convert the object to a path, you lose the ability to edit the specific properties of the original object. From that point on, the object will be a simple polyline/polygon and you can only apply affine transformations. So, as long as you want to change the object properties and expect your stroke to adapt to those changes, do not convert the object to a path.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme