Is there a script to create centerline between two bezier curves?
What exactly is the centerline of two bezier curves?
There is a Show Center lines plug-in in Window > Plugin Manager which shows you subtle vertical and horizontal guides in the center of your selection. Does that help?
thanks.
But this is not what I was looking.
I want to create a middle curve between two curves
similar to blend option in photoshop
You put one of the lines in the background, and use Filter > Transform > Background with 50%.
@mekkablue
Please check. I have copied a curve to background and offsetting the curve in the foreground. Both curves are compatible.
filter is not offsetting the curve in the foreground from its original position towards the curve in the background by 50%
6%
50%

There is not a script for that I know of, but you can achieve that by using the Offset Curve filter.
The steps I used to recreate the /S:
- Select the outside path only;
- Copy, then Paste so you have it overlaying the original; do not de-select the duplicated path;
- With your pasted path still selected, use Filter > Offset Curve, make sure Make Stroke is selected, with a value of 50%;
- Enter the value of the glyph stem width for both fields; click on Offset;
- Option-delete the corner node on the new outer path at each end of the path.
- Delete the remains of the new outer stroke.
It will only work correctly on glyphs which have a constant stem width. Glyphs with differing stem widths would require manual corrections.
This seems like a lot of steps, but once you’ve done it once or twice it takes less than a minute to do a glyph. It might be scriptable but it would be complex.
Verify path directions. Reverse if necessary.
I wrote a script for this a while back and it was just laying around, so I published it to my GitHub. It is called Create Centerline: https://github.com/harbortype/glyphs-scripts
same issue. but centerline script does exactly what I need
thank you very much. This is extraordinary.
Some very useful scripts.
Thanks for sharing.
Does this script still work? I receive the following error:
Traceback (most recent call last):
File “/Users/mac/Library/Application Support/Glyphs/Scripts/vanilla/vanillaBase.py”, line 505, in action_
self.callback(sender)File “/Users/mac/Library/Application Support/Glyphs/Scripts/glyphs-scripts-main/Paths/Create Centerline.py”, line 66, in interpolatePaths
if (len(selectedPaths[0]) != len(selectedPaths[1])):TypeError: object of type ‘GSPath’ has no len()
I’ve just tested it and it works for me. Can you show us a screenshot of the paths you are trying to interpolate?
Are you using Glyphs 2? I think it needs len(path.nodes)
instead of len(path)
The len(path)
is possible if you have used any script that uses RoboFab. I recommend not to use this syntax.
Aha, I did not know that. I just pushed an update for the script that should fix this.
And I couldn’t help to clean up the script a bit. Send a pull request.
Many thanks Henrique. This is a fantastic tool.