How to avoid distortions with Stroke to Path?
How to avoid distortions with Stroke to Path?
When changing a stroke to path you get unwanted distortions. I wouldn't call them minor.
1. Why?
2. How to avoid them? Is there a preference setting which I haven't found yet?
Example:
To duplicated paths on top of each other. Black bottom, red top.
After "stroke to path" of the top red path you can see the unexpected and unwanted distortions.
1. Why?
2. How to avoid them? Is there a preference setting which I haven't found yet?
Example:
To duplicated paths on top of each other. Black bottom, red top.
After "stroke to path" of the top red path you can see the unexpected and unwanted distortions.
Win7/64, Inkscape 0.92.2
Re: How to avoid distortions with Stroke to Path?
My guess is you have some path effects on the original objects.
If you convert those to paths before (Ctrl+Shift+C) the stroke to path (Ctrl+Alt+C), it "should" look as expected. (Although end caps and miters can end up with errors unrelated to that example.)
If you convert those to paths before (Ctrl+Shift+C) the stroke to path (Ctrl+Alt+C), it "should" look as expected. (Although end caps and miters can end up with errors unrelated to that example.)
Re: How to avoid distortions with Stroke to Path?
Not that I know of. I haven't used any LPE. These are just some Bézier curves. There is nothing to convert with Shift+Ctrl+C.Lazur wrote:My guess is you have some path effects on the original objects.
The status bar tells me: Path 8 nodes on layer Layer1
Well, if I break this path (Shift+Ctrl+K) into its 4 subpaths and do "Stroke to Path" for each subpath individually, I do not see distortions.
Does this mean, if I have a path consisting of 50 or more subpaths I have to break it and do it individually 50 times to avoid distortions? Are you serious?
Last edited by theozh on Wed Oct 11, 2017 6:58 pm, edited 1 time in total.
Win7/64, Inkscape 0.92.2
Re: How to avoid distortions with Stroke to Path?
Hmm weird.
Does it work right after breaking apart -when all subpaths are still selected? If so there would be no need for going over them one by one.
Does it work right after breaking apart -when all subpaths are still selected? If so there would be no need for going over them one by one.
Re: How to avoid distortions with Stroke to Path?
OK. Yes...
The intuitive, direct way doesn't seem to work without distortions:
1. select combined path
2. Stroke to Path
You get distortions.
Workaround without distortions:
1. select combined path
2. break appart (fortunately, all the subpaths stay selected)
3. Stroke to Path (fortunately, all the subpaths stay selected)
4. Union
No obvious distortions.
It's not clear to my why the first version shouldn't work properly...
Not obvious to me... worth a bug report?!
The intuitive, direct way doesn't seem to work without distortions:
1. select combined path
2. Stroke to Path
You get distortions.
Workaround without distortions:
1. select combined path
2. break appart (fortunately, all the subpaths stay selected)
3. Stroke to Path (fortunately, all the subpaths stay selected)
4. Union
No obvious distortions.
It's not clear to my why the first version shouldn't work properly...
Not obvious to me... worth a bug report?!
Win7/64, Inkscape 0.92.2
Re: How to avoid distortions with Stroke to Path?
Yes, probably worth a bug report -if regression wasn't reported already.
Re: How to avoid distortions with Stroke to Path?
Actually, my curves were B-Splines....
Well, for this, there is already a bug report.
https://bugs.launchpad.net/inkscape/+bug/1502587
Although, with single paths it seems to work for me but not with combined paths.
Well, for this, there is already a bug report.
https://bugs.launchpad.net/inkscape/+bug/1502587
Although, with single paths it seems to work for me but not with combined paths.
Win7/64, Inkscape 0.92.2
Re: How to avoid distortions with Stroke to Path?
well, also with (now really) Bézier curves I observe distortions. Blue=original path, Red=Stroke to Path.
This time, the "Stroke to Path" gets even thicker at some place...
This time, the "Stroke to Path" gets even thicker at some place...
Win7/64, Inkscape 0.92.2
Re: How to avoid distortions with Stroke to Path?
As they are just around the crossings, I'd guess these are numeric imprecisions. Do they get smaller when you enlarge the paths first or when you set the precision value to a higher precision?
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: How to avoid distortions with Stroke to Path?
I have set the precision to the maximum (Numeric precision 16 digits and Minimum exponent -10). But I'm not sure whether this at all influences the calculation precision of Inkscape or just determines the SVG number output.
Well, if I enlarge the path e.g. by 500% and do the "Stroke to Path" it seems to look better.
However, if I shrink the new path again to 20% the resulting path is thinner than the original and expected path. So, it's not really a feasible workaround to scale up, do "Stroke to Path" and scale down again...
I always thought the advantage of vector graphics is that you can easily scale things and it always stays the same quality. Have I misunderstood this?...
Well, if I enlarge the path e.g. by 500% and do the "Stroke to Path" it seems to look better.
However, if I shrink the new path again to 20% the resulting path is thinner than the original and expected path. So, it's not really a feasible workaround to scale up, do "Stroke to Path" and scale down again...
I always thought the advantage of vector graphics is that you can easily scale things and it always stays the same quality. Have I misunderstood this?...

Win7/64, Inkscape 0.92.2
Re: How to avoid distortions with Stroke to Path?
Actually, it's difficult for me to believe that this should be numeric imprecision.
A concrete example:
One node of a crossing which should be at coordinates x=73.12, y=264.17 is actually located at x=73.023, y=264.348 (that's about 0.1% off. Well, a detail, who cares
).
If Inkscape really calculates with 8 or 16 digits why or how should it result in such a "large" error?
And the second workaround above shows that Inkscape CAN do better. So, my tentative guess is that there is something wrong with the algorithm to find the intersection on a combined path and create the proper new path.
A concrete example:
One node of a crossing which should be at coordinates x=73.12, y=264.17 is actually located at x=73.023, y=264.348 (that's about 0.1% off. Well, a detail, who cares

If Inkscape really calculates with 8 or 16 digits why or how should it result in such a "large" error?
And the second workaround above shows that Inkscape CAN do better. So, my tentative guess is that there is something wrong with the algorithm to find the intersection on a combined path and create the proper new path.
Win7/64, Inkscape 0.92.2
Re: How to avoid distortions with Stroke to Path?
Grouping after stroke to path and before shrinking could work - it only applies transforms, then...
Inkscape is performing several unit conversions in the background, and those add up (or rather, multiply). Could be an explanation.
Inkscape is performing several unit conversions in the background, and those add up (or rather, multiply). Could be an explanation.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Re: How to avoid distortions with Stroke to Path?
theozh wrote:Not that I know of. I haven't used any LPE. These are just some Bézier curves. There is nothing to convert with Shift+Ctrl+C.Lazur wrote:My guess is you have some path effects on the original objects.
The status bar tells me: Path 8 nodes on layer Layer1
Well, if I break this path (Shift+Ctrl+K) into its 4 subpaths and do "Stroke to Path" for each subpath individually, I do not see distortions.
Does this mean, if I have a path consisting of 50 or more subpaths I have to break it and do it individually 50 times to avoid distortions? Are you serious?
StrokeToPathDistortion3.png
Can´t you just upload such a problematic Inkscape file - so we can check what our version will do with it?
I never experienced this kind of issue.
Cheers
P
Re: How to avoid distortions with Stroke to Path?
@Polygon, find attached a sample... I'm curious how this behaves on your versions...
- Attachments
-
- StrokeToPathDistortion.svg
- (43.46 KiB) Downloaded 183 times
Win7/64, Inkscape 0.92.2
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: How to avoid distortions with Stroke to Path?
Like the text/outset issue, this may something to do with the proximity of nodes and handles? It is reduced somewhat by using the document 1:1 scale (px/uu) but exists nonetheless.
Reproduced in winxp-32, inkscape Inkscape 0.91 r13725.
Reproduced in winxp-32, inkscape Inkscape 0.91 r13725.
Have a nice day.
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
Re: How to avoid distortions with Stroke to Path?
I think I found something and scale plays a role.
The smaller the stroke the worser it gets:

Cheers
P.
The smaller the stroke the worser it gets:

Cheers
P.
Re: How to avoid distortions with Stroke to Path?
I don't have as severe distortions as you have produced, but I do some distortions when there should be none.
Should definitely be reported as a bug, if it hasn't been already.
Inkscape 0.92.2, 64-bit, 7z pkg, Windows 7 Pro, 64-bit
Should definitely be reported as a bug, if it hasn't been already.
Inkscape 0.92.2, 64-bit, 7z pkg, Windows 7 Pro, 64-bit
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: How to avoid distortions with Stroke to Path?
Not sure it's really a bug... but an artifact related to proximity of bezier nodes.


Last edited by tylerdurden on Fri Oct 13, 2017 9:51 pm, edited 1 time in total.
Have a nice day.
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: How to avoid distortions with Stroke to Path?
Have a nice day.
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
Re: How to avoid distortions with Stroke to Path?
Isn't proximity of other nodes to be expected? How could you avoid it in the original use case here?
Edit
Well, proximity of which nodes? In the original use case, the 4 nodes at the intersection can't be avoided. But maybe you're thinking of other nodes?
Edit
Well, proximity of which nodes? In the original use case, the 4 nodes at the intersection can't be avoided. But maybe you're thinking of other nodes?
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: How to avoid distortions with Stroke to Path?
The separate paths convert stroke no problem. So the compound path nodes must interact in stroke conversion.
The more nodes, or at least more nodes in the compound path near the intersections, the more accurate the conversion likely will be.

The more nodes, or at least more nodes in the compound path near the intersections, the more accurate the conversion likely will be.

Have a nice day.
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
Re: How to avoid distortions with Stroke to Path?
Oh ok. So you're thinking, the more nodes, the more calculations, the more rounding errors? Or if not rounding, then some other errors.
Thanks for explaining.
Thanks for explaining.
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: How to avoid distortions with Stroke to Path?
I guess it's the same numeric issue as often happens with union - it must be doing a union internally.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)
Inkscape FAQ - Learning Resources - Website with tutorials (German and English)