|
Author |
Topic: Exporting Bezier Curves? (Read 388 times) |
|
membla
|
Exporting Bezier Curves?
« on: Jan 6th, 2004, 4:17am » |
|
Hi, I was looking for a plugin for Illustrator where you could export bezier curves or in some way get hold of their numerical values, so in that way i could use my illustrations in processing. However, no luck on that. Anyone got any idea about this? Perhaps im better of writing a decent illustrating program in proccesing? Or, better yet, is there already such a marvellous thing? Nick
|
|
|
|
benelek
|
Re: Exporting Bezier Curves?
« Reply #1 on: Jan 6th, 2004, 5:02am » |
|
I don't own a copy of Illustrator myself (nor do I use it), but you might try exporting your file as a CSV filetype. If this is possible, you might be able to pick out which values in the file are associated with your beziers, and then you could write some Processing code to read the CSV file. Hope this helps.
|
|
|
|
Ethan
|
Re: Exporting Bezier Curves?
« Reply #2 on: Jan 6th, 2004, 7:46am » |
|
Nick- I had the same question, unfortunatly I don't think I'll have time to work on it in the near future.
|
|
|
|
membla
|
Re: Exporting Bezier Curves?
« Reply #3 on: Jan 6th, 2004, 5:09pm » |
|
I very much appreciate your leads. I'll be sure to let you know when i find a solution. Thanks again.
|
|
|
|
amoeba
|
Re: Exporting Bezier Curves?
« Reply #4 on: Jan 6th, 2004, 8:28pm » |
|
The Adobe Illustrator format is actually not that complex, mostly it's a less verbose version of Postscript with added functionality. It is described in this PDF document: Adobe Illustrator File Format Specification. Note that this is the AI 7.0 format, I usually save files as AI 3.0 files if I want to extract data. In Illustrator CS, this is only possible through using Export -> Illustrator Legacy. If all you want to do is extract curves, you can do the following while reading the file: 1. Skip lines until to the line that says "%%EndSetup". 2. When you find a line that matches "x y m" (x and y being numbers, start a new path with the current point defined by the coordinates given. 3. "x y [l/L]" means lineto. Add a line from the current point to the new point. 4. "x y x y x y [c/C]" is a curveto. Add a curve segment using the current point as the starting point, then complete it using the three points given. 5. n/N/s/S/f/F/b/B operators on a single line mean that the path is complete. Some of these specify that the path should be closed (connected to the first point), others that it remain open. Illustrator has two special operators y/Y and v/V for specifying curves with corners or smooth points, but just looking for the c/C operator will give you most bezier curves in a document. Hope this makes sense. I've meaning to make a proper library for import for years now, which means I probably never will. Oh well. Look forward to seeing someone else's efforts
|
« Last Edit: Jan 6th, 2004, 8:33pm by amoeba » |
|
marius watz // amoeba http://processing.unlekker.net/
|
|
|
|