Stroke inside/outside path?

Asked by Jimmy Volatile

Is it possible to offset the stroke from the path?

I'm asking because I'd like to create a number of boxes with somewhat thick borders aligned in a 4x4 grid. However, if I set the stroke thickness to 10px, the stroke is centered on the path and thus covers both 5px width of the box itself as well as 5px width of the boxes around it.

Now, if I'd like to reduce the stroke width of one of the boxes around the edge of the grid to 2px, the outline of the grid would no longer be a uniform straight line but would have an indentation of 4px at that particular box.

If it is possible to make the stroke align to the inside of the path, it would be possible to juggle the width of identically sized boxes without having to modify the size of the box to ensure that the outside edges still aligns to the other boxes.

The same goes for aligning the stroke to the inside of the path.

Any suggestions will be greatly appreaciated.

Question information

Language:
English Edit question
Status:
Solved
For:
Inkscape Edit question
Assignee:
No assignee Edit question
Solved by:
su_v
Solved:
Last query:
Last reply:
Revision history for this message
Best su_v (suv-lp) said :
#1

> Is it possible to offset the stroke from the path?
You mean like this: <http://launchpadlibrarian.net/11806648/outset_inset.svg> (attached to bug #170898)?

1) Short answer: no
It's not in the SVG specification <http://www.w3.org/TR/SVG11/painting.html#StrokeProperties>

2) Wishlist (bug) reports:
Bug #170898 in Inkscape: “Facilitate outset/inset by half stroke width”
Bug #319783 in Inkscape: “Support "inside" and "outside" stroking of paths” (duplicate)
Bug #411622 in Inkscape: “inconsistent change of stroke width” (duplicate)

3) Workaround as described in bug #170898:
"Indeed there's nothing like that in SVG. But you can achieve this by creating an offset duplicate, or linked offset, of the original shape and outsetting it by half of stroke width."

4) aligning grid objects with changed stroke widths
Bug #302044 in Inkscape: “Size should optionally adjusted to match old BB when stroke changes”

There may more workarounds as described in 3) - haven't needed it myself yet, but will add links if I come across another one ;-)

hth, ~suv

Revision history for this message
Jimmy Volatile (spam-useful) said :
#2

Thanks! This solves my immediate problem but clearly, it's not a very scalable solution. I did try out the suggested duplicate offset and although it works like a charm, it's not very viable in larger, more complex images.

Adhering to standards is a Very Good Thing, but where the standards fall short, the ingenuity and creativity of the Inkscape Developers must take over. As it is now, we have a pretty decent design application which actually supports automatic drawing of gears/cogwheels as a path effect (never used), but does not support showing semi-transparent strokes around an object (used practically every day).

In my experience as a designer, this is one of the path or object properties where I often make decisive and significant adjustments. Actually, if Inkscape only supported the excellent Path Effects, I'd be happy knowing I could make any path possible by simply designing it myself. However, I know this would in most cases this would create enormously bloated documents.

Cheers, Jimmy Volatile

Revision history for this message
Jimmy Volatile (spam-useful) said :
#3

Thanks ~suv, that solved my question.