Loading
Hey! This thing is still a Work in Progress. Files, instructions, and other stuff might change!

Export OpenSCAD paths from Adobe Illustrator

by kitlaan, published

Export OpenSCAD paths from Adobe Illustrator by kitlaan Jun 22, 2011

Description

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.)

Recent Comments

view all
I confirm that it works in Illustrator CS5! :) You have to copy the plugin file in the right path of Illustrator (C:program filesAdobeAdobe illustrator 5.1Plug-insExtensions) And after when you export your 2D drawing you can save it in .SCAD and extrude it from there. If you have any question ask me I'll try to help you
 I've tried it on cs4, and it doesn't show up as an export option. I did a tiny bit of reading and it looks like they changed a lot of back end things between cs3 and cs6. maybe that broke this plugin.
I feel your pain, which is why I wrote the plugin to begin with. My hope is for OpenSCAD to support POLYLINE DXF in the future...

Sadly, I don't have CS5 to play with (and this plugin was my first try at one too) so I don't have a way to debug. What problems are you seeing?

Liked By

view all

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag. Print Thing Tag

Instructions

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)

Features:
* only supports exporting the points in a path as straight line segments.
* only closed paths are exported
* hidden layers are not exported

v0.1: 2011-06-21
* initial version
* polygon points are in pt units (scale down by 72/25.4 to get mm)

v0.2: 2011-06-22
* 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.

Source: 2011-06-27
* 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.

Future:
* Curved paths using bezier support (specify max curve approx angle; min between points; etc).
I confirm that it works in Illustrator CS5! :) You have to copy the plugin file in the right path of Illustrator (C:program filesAdobeAdobe illustrator 5.1Plug-insExtensions) And after when you export your 2D drawing you can save it in .SCAD and extrude it from there. If you have any question ask me I'll try to help you
 I've tried it on cs4, and it doesn't show up as an export option. I did a tiny bit of reading and it looks like they changed a lot of back end things between cs3 and cs6. maybe that broke this plugin.
I feel your pain, which is why I wrote the plugin to begin with. My hope is for OpenSCAD to support POLYLINE DXF in the future...

Sadly, I don't have CS5 to play with (and this plugin was my first try at one too) so I don't have a way to debug. What problems are you seeing?
I just can't seem to get this working with CS5. Isn't there any way to get polyline DXF's out of illustrator? Or OpenSCAD polygons? Or some other format? It's nice that Inkscape exists, but I don't want to use it. Why does this have to be so hard?
You don't mention anything about what to do with the plugin to make it work. I dragged it to my plugins folder on a machine running CS4 and I couldn't find it anywhere in the menus. Trying it now on a machine running CS3 and I still don't see anything.
I only have CS3 to test on, but all I did was put it in the Illustrator plugin directory.

From there, it just shows up as a "supported file type" when you do a File
&
gt;Export.
Just from the number above (I don't have Adobe Illustrator) you might calculate a cleaner scale number by going from points to inches (1" = 72 points) then from inches to mm (1" = 25.4mm), giving you points-to-mm as 1mm=72/25.4. Don't know if Illustrator lets you change/access the DPI, but that might make your code more flexible.
Good point; using better hardcoded constants is preferable to one that seems pretty random.
Top