Turn a BezierPath into an SVG file

by Bob Ueland   Last Updated September 14, 2018 15:12 PM

I have a NSBezierPath produced from code below that I want to turn this path into a svg file that I can import into Adobe Illustrator. Any ideas how to do this?

+(NSBezierPath *)myPath {
    NSBezierPath* bezierPath = [NSBezierPath bezierPath];

    [bezierPath moveToPoint: NSMakePoint(1.5, 30.21)];
    [bezierPath curveToPoint: NSMakePoint(13.24, 42.82) controlPoint1: NSMakePoint(2.47, 33) controlPoint2: NSMakePoint(3.6, 46.45)];
    [bezierPath curveToPoint: NSMakePoint(7.59, 1.5) controlPoint1: NSMakePoint(21.01, 39.89) controlPoint2: NSMakePoint(8.12, 5.14)];
    [bezierPath lineToPoint: NSMakePoint(16.34, 29.42)];
    [bezierPath curveToPoint: NSMakePoint(44.05, 32.78) controlPoint1: NSMakePoint(34.17, 52.85) controlPoint2: NSMakePoint(45.36, 40.26)];
    [bezierPath curveToPoint: NSMakePoint(36.83, 9.88) controlPoint1: NSMakePoint(42.23, 23.27) controlPoint2: NSMakePoint(38.63, 13.24)];
    [bezierPath curveToPoint: NSMakePoint(52.68, 13.34) controlPoint1: NSMakePoint(33.29, 3.26) controlPoint2: NSMakePoint(45, -6.33)];

    return bezierPath;
}
Tags : macos


Related Questions


Where is Google Voice and Video installed?

Updated October 24, 2016 09:05 AM

How to disable the deadzone for scrolling on MacOS?

Updated November 02, 2016 09:05 AM

How to clean system space

Updated November 26, 2016 07:15 AM