View Single Post
I write a AppleScript to parser my data which from my test program, and it could let OmniGraphSketcher draw my output path with line or curve.

For example with those data which generate from TTF font outline path.
Because OmniGraphSketcher's curve doesn't support to use bezier curve control pointer, so before output curve data from my program, I use the bezierat2() function to convert the control pointer to OmniGraphSketcher's control pointer in my program.

-- float bezierat2( float a, float b, float c, ccTime t )
-- {
-- t = 0.5f;
-- return (powf(1-t,2) * a + 2*t*(1-t)*b + powf(t,2)*c );
-- }

Copy those text and paste by my AppleScript to OmniGraphSketcher.

LineTo {(267.000000, 653.000000), (267.000000, 571.000000)}
CurveTo {(267.000000, 571.000000),(165.000000, 513.000000), (210.000000, 556.500000)}
CurveTo {(165.000000, 513.000000),(130.000000, 392.000000), (138.750000, 457.250000)}
CurveTo {(130.000000, 392.000000),(165.000000, 271.000000), (138.750000, 326.250000)}
CurveTo {(165.000000, 271.000000),(267.000000, 212.000000), (210.000000, 226.750000)}
LineTo {(267.000000, 212.000000), (267.000000, 130.000000)}
CurveTo {(267.000000, 130.000000),(95.000000, 216.000000), (169.000000, 151.500000)}
CurveTo {(95.000000, 216.000000),(40.000000, 392.000000), (53.750000, 297.000000)}
CurveTo {(40.000000, 392.000000),(95.000000, 571.000000), (53.750000, 489.250000)}
CurveTo {(95.000000, 571.000000),(267.000000, 653.000000), (169.000000, 632.500000)}

CurveTo {(267.000000, 653.000000),(442.000000, 571.000000), (367.250000, 632.500000)}
CurveTo {(442.000000, 571.000000),(497.000000, 392.000000), (483.250000, 489.250000)}
CurveTo {(497.000000, 392.000000),(442.000000, 216.000000), (483.250000, 295.000000)}
CurveTo {(442.000000, 216.000000),(267.000000, 130.000000), (367.250000, 151.500000)}
LineTo {(267.000000, 130.000000), (267.000000, 212.000000)}
CurveTo {(267.000000, 212.000000),(372.000000, 271.000000), (326.250000, 226.750000)}
CurveTo {(372.000000, 271.000000),(403.000000, 392.000000), (395.250000, 326.250000)}
CurveTo {(403.000000, 392.000000),(372.000000, 513.000000), (395.250000, 457.250000)}
CurveTo {(372.000000, 513.000000),(267.000000, 571.000000), (326.250000, 556.500000)}
LineTo {(267.000000, 571.000000), (267.000000, 653.000000)}



and could get the output in OmniGraphSketcher.
Attached Thumbnails
Click image for larger version

Name:	pic.png
Views:	806
Size:	43.1 KB
ID:	2615  
Attached Files
File Type: zip Paste Points.zip (60.0 KB, 413 views)