# Average stroke from a fill

I would like to generate an average stroke from a given compound enclosed path, or fill, in Adobe Illustrator CC or Inkscape.

Sorry I don't know the mathematical function name to achieve this. I've come upon a couple bizarre hacks involving Photoshop, but it stands to reason there is a simpler way to achieve this within a vector program. Unfortunately Illustrator's path averaging collapses my example into a single point, likely because it has both horizontal and vertical aspects.

• Sounds like a mathematically highly non-trivial task to me. Even for a human it’s impossible to tell whether the result should be yours or one where there are two non-intersecting paths: one connecting the bottom two endpoints and one connecting the top two endpoints. Feb 20, 2015 at 18:07

Using Inkscape...

tl;dr Interpolate paths

As a generalized case, this is a very interesting question, for which I have a reasonable answer. However, your specific example is further complicated by the fact that your desired resulting "path" requires multiple disconnected, intersecting sub-paths (one for the horizontal line, and one for the vertical line). So, I'll be answering the more general (and simpler) case of one continuous, non-intersecting path, as summarized below:

Steps:

1. To set up the example, begin with a simple path having some substantial stroke width.

1. Choose "Path" > "Stroke to Path"

1. Mess with the nodes to create a more interesting example.

1. Remove fill, and set a thin stroke.

1. Delete the two endpoint segments. Then choose "Path" > "Break Apart"

1. Important: Select one of the resulting objects (either one) and choose "Path" > "Reverse".

2. Select the two objects and choose "Extensions" > "Generate from path" > "Interpolate". (Make sure settings on the Interpolate extension are set as follows.

1. Delete the two original paths, leaving only the interpolated path. It will be a group. You can choose "Object" > "Ungroup" to remove the group container and just have a plain old path.

1. Style with thickness to taste. From here, you could simplify or tweak as desired.

• Upon testing this method, I see what Sean meant by my example not being ideal. The lack of endpoints creates a problem which results in a non-meaningful interpolation. I went back and live-traced the original sketches in Adobe Illustrator in stead and saw there were some options for line art, which does a decent job if I tweak it and does create strokes. I have few enough samples that I can just draw in what I need, so I may just drop an automated solution and hope it doesn't come up again. Feb 21, 2015 at 5:50