I need to cut a shape exatly in the middle position maintaining/keeping its outer shape/design. I dnt wanna use pen tool, neither I wanna do it manually. I need to color this two parts in different colors.

is there any trick or way to do it? please help :'(

enter image description here

  • 1
    Yes well sortof. You can offset by half of the width.
    – joojaa
    Commented Apr 5 at 15:36
  • :O :O :O so trueee!!!!! U r brilliant. Thank you so much. <3 Commented Apr 5 at 15:39
  • 1
    There is atleast one software that does this see sthu.org/code/stalgo
    – joojaa
    Commented Apr 5 at 15:44
  • :O :O :O plz take my mount everst size gratitude :o :O :O.... THANK YOU SO MUCH. Commented Apr 5 at 15:48

1 Answer 1


This resembles a problem that appears numerous times in old questions: A person has a shape which looks like it could have at least an approximate centerline. He wants to generate that centerline by using Illustrator or Inkscape functions instead of drawing it manually. An example:

enter image description here

The person has the grey filled shape in the left or the equivalent vector outline in the right. The green line doesn't exist, it's only a dream which should somehow become real. (I drew the green line at first and bulged the rest around it with effects).

The grey or black shape, of course, is rarely this simple in the questions, because even a beginner would draw the green line with the pen after practicing a while. A common really existing shape was text, the questioner wanted to generate the centerline version of the text for engraving.

Another common case: The shape was a wide stroke raster image and the questioner wanted to generate a centerline vector trace of it. In Illustrator and Inkscape the centerline tracing fails miserably in line crossings and when there's wide stroke width changes like in the example above. The actual question was "How to fix the centerline tracing or how to find the centerline from the normal fill-only tracing result?"

Making an offset path can be useful if the shape has constant width. It's not if if the shape has large width changes like the example above and one cannot easily at first remove them. Your case needs only a few straight lines + the shape builder to make the shape (or actually a copy of it) to have constant width, so offset path really could be the solution. To get a single path only cut the ends of the offset path loop open and keep the better curve.

Numerous times people have tried to open the shape ends and to make a 1-step blend between the curves in Illustrator or to run extension 1-step interpolate in Inkscape. The red curve in the next image presents the common result:

enter image description here

The actual question was "Blending (or path interpolation) generally works well, but how to make it work also in this case?"

reasons of the miserable result:

  • the curves have different number of anchor points or they are distributed radically differently along the curves
  • in case the result is like a knot one of the curves has reversed direction. Reversing the path fixes it to the shown (=red) case.

Sometimes the result of the blending can be improved in Illustrator by simplifying the curves. One must select the unexpanded blend and apply Object > Path > Simplify > Preview and try different combinations for the sliders:

enter image description here

Moving the sliders in small increments finally gave the result above. It's pure luck that such combination both existed and was found. But it's not perfect, some manual edits are still needed. I guess any experienced Bezier curve drawing tool user laughs.

Inkscape has one advantage. There Path > Simplify finds the minimum amount of nodes which is actually needed for a curve and removes the rest. In the next image you see the superfluous mass of unnecessary nodes in the left. In the right Path simplify is applied:

enter image description here

Those unnecessary nodes are born easily when one traces a bitmap or uses shape builder or other effects.

In Inkscape extension Generate from path > Interpolate paths generates quite the same result from both versions (lower path was in bot cases reversed to prevent making a knot)

enter image description here

The expected result is shown for a reference. There's still some unwanted twists, but the result is substantially better than the red one in Illustrator. The improvement is based on the option to allow Inkscape to temporarily split the paths to shorter sections and to balance the node distributions.

Path interpolation generates (like effects generally do) numerous unnecessary nodes. The path interpolated from the simplified pair of curves is shown in the next image. The upper half shows the nodes The lower half is a duplicate placed on the expected result for comparison:

enter image description here

In the next image Path > Simplify is applied again. It, of course, didn't remove the twist in the middle of the interpolated curve, but after simplifying the twist contained only one node. Removing it manually removed the twist, too.

enter image description here

A different approach

Anything which resembles the wanted result seems to need some manual trickery if one tries to create it automatically in Illustrator or Inkscape. Are all programs as poor as Illustrator and Inkscape?

No, they aren't. CAD programs can do it easily and fast. An example:

enter image description here

The SVG is imported to an entry level CAD program. A 2-segment polyline is drawn between the left ends of the curves. It's colored temporarily to red. It's essential to have a polyline which has 2 segments and a joint node in the midpoint.

In the next image the polyline is swept to a surface. The original SVG paths are used as sweep rails:

enter image description here

The top image is the result of the sweep. The bottom image contains the original SVG paths and the midline seam path generated by the mid-joint of the polyline. Extracting them was easy - only select the 3 curves, copy and paste to a different place.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.