What changes the length and thickness of rounded strokes?

General discussions about Inkscape.
theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

What changes the length and thickness of rounded strokes?

Postby theozh » Wed Mar 01, 2017 4:30 am

If you have a straight horizontal line, e.g. length 200mm, Stroke 100mm
The size of this object, i.e. the bounding box, Width x Height depends logically on the end caps.
Butt cap: 200 x 100 (as expected)
Round cap: 301.424 x 100.01 (Why ???)
Square cap: 300 x 100 (as expected)

What is the reason? Can anybody explain? Why such strange numbers?
I thought the round caps are just two added half circles with a diameter identical to the stroke width.

If I believe the manual the bounding box width should always be like the round one.
Quote: "Note The bounding box is determined by assuming the Cap style is Round. "
http://tavmjong.free.fr/INKSCAPE/MANUAL ... troke.html
Win7/64, Inkscape 0.92.2

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: What changes the length and thickness of rounded strokes?

Postby brynn » Wed Mar 08, 2017 1:10 pm

The way I interpret that quote, is it applies to the bevels. Although that doesn't make much sense either. Maybe that's one of the many parts of the manual which are outdated?

Does this happen with geometric bounding box?

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: What changes the length and thickness of rounded strokes?

Postby theozh » Wed Apr 05, 2017 5:09 am

What do you mean with geometric bounding box?
It's the width and height in the tool controls bar which changes unexpectedly when you go to "Rounded Cap".
Win7/64, Inkscape 0.92.2

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: What changes the length and thickness of rounded strokes?

Postby brynn » Wed Apr 05, 2017 7:35 pm

I can't confirm the change of line width with different cap styles (0.92.1). Well, not with geometric bounding box.

But it does change if you use the visual bounding box, as it should.

The bounding box options are not just about the bounding box. They are about whether the stroke width (and a few other things like miter or bevel style, cap style, etc.) are included in both the bounding box and object size or dimensions. For visual bounding box, those things are included. For geometric bb, they are not included.

To be honest, I was too lazy to test for myself, when I read your message the first time. So I was asking you which kind of bounding box you saw these things, mostly to make sure what you were seeing wasn't a bug (or maybe a new feature that I didn't know about).

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: What changes the length and thickness of rounded strokes?

Postby theozh » Wed Apr 05, 2017 9:29 pm

OK, to make sure that we are talking about the same thing... Yes, the miter is another thing.

The lines in the GIF-demo have a length of 100 mm and a stroke width of 100 mm.
For the square cap I understand and expect the addition of a half square (stroke width x stroke width) on each end. This gives a new line length (here: bounding box WIDTH) of 200 mm, whereas the (stroke) width (here: bounding box "HEIGHT") stays the same. All fine!

For the round cap I understand and expect the addition of a half circle on each end with a diameter of stroke width. Which should give the same bounding box width (200 mm) and height (100 mm) as in the square cap case.
However, it changes to width 201.424 and height 100.010. My question is why?

RoundedStrokeGetsThicker&Longer.gif
RoundedStrokeGetsThicker&Longer.gif (96.86 KiB) Viewed 2483 times
Win7/64, Inkscape 0.92.2

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: What changes the length and thickness of rounded strokes?

Postby theozh » Wed Apr 05, 2017 9:59 pm

...to say it in another image:
top: expected rounded cap
bottom: exaggerated rounded cap
Maybe the complete path gets thicker, but that's contradictory because the stroke width is still 100 mm not 100.010 mm
ExaggeratedRoundedCap.png
ExaggeratedRoundedCap.png (2.37 KiB) Viewed 2474 times
Win7/64, Inkscape 0.92.2

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: What changes the length and thickness of rounded strokes?

Postby tylerdurden » Wed Apr 05, 2017 10:52 pm

Looks like a bounding box error, the stroke seems to be the correct size.

Tested with a 2000px line having a red 1000px stroke.
Duplicated the line and put a round cap on green copy, moved behind red original.
BigRoundCap.svg_-_Inkscape_2017-04-05_08-47-22.png
BigRoundCap.svg_-_Inkscape_2017-04-05_08-47-22.png (38.18 KiB) Viewed 2466 times
Attachments
BigRoundCap.svg
(2.33 KiB) Downloaded 248 times
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/

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: What changes the length and thickness of rounded strokes?

Postby theozh » Wed Apr 05, 2017 11:03 pm

Thanks, @tylerdurden, for checking.
When you use stroke to path afterwards it takes the wrong values from the bounding box and you don't get the originally intended object size. I will check/file a bug report on launchpad.
Win7/64, Inkscape 0.92.2

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: What changes the length and thickness of rounded strokes?

Postby brynn » Thu Apr 06, 2017 2:03 am

I agree, the change in height is totally unexpected, and probably, if not a bug itself, then bug-related.

My best guess is that the change in width (beyond what is expected) is probably related to the the same problem or bug as the height change.

theozh
Posts: 437
Joined: Fri Mar 23, 2012 6:30 pm

Re: What changes the length and thickness of rounded strokes?

Postby theozh » Thu Apr 06, 2017 8:42 pm

Win7/64, Inkscape 0.92.2


Return to “General Discussions”