This is a plugin for Adobe Illustrator (CS3, Windows) to export paths (and only straight-line paths!) to an OpenSCAD file.
Since Illustrator CS3 (and higher) exports only DXF R13+, it'll generate POLYLINE and other objects, which OpenSCAD does not support. By using this export plugin, you'll be able to use the path directly as a polygon().
(Supposedly CS3 plugins are loadable with CS4 and CS5.)
This is very preliminary; I don't expect it'll crash Illustrator (so far it hasn't), but who knows...
To convert curved paths into straight segments,
- Object > Path > Add Anchor Points (once or twice, or more depending on your wanted resolution)
- Object > Path > Simplify (check 'Straight Lines'; a 2% angle threshold is what I start with)
- only supports exporting the points in a path as straight line segments.
- only closed paths are exported
- hidden layers are not exported
- initial version
- polygon points are in pt units (scale down by 72/25.4 to get mm)
- polygon points now prescaled to mm.
- guide paths filtered out
- bounding box size of each polygon (and total of all) outputted as comment; (makes moving the polygon around easier to calculate)
v0.3: 2011-06-27 (uploaded 2011-07-26)
- whoops. forgot to upload the build that corresponded to the source.
- Code should be a decent example of making an Illustrator export plugin.
- There is a README.txt included which documents what you need to build. The code should be compatible with Xcode, but I don't have the environment available to try.
- Bezier interpolation support in-progress; still trying to figure out how to work it out using Illustrator APIs.
- Curved paths using bezier support (specify max curve approx angle; min between points; etc).