Note: This code is no longer under active development. See below for more details.
gh-svg is a plugin for exporting svg data from the Grasshopper and Rhino 3D modeling environments. The intent is work towards create greater interoperability between different geometry editing softwares using open-source data format standards, as well as making it easier to create dynamic interfaces for topics that rely heavily on illustration and geometry, such as architecture, urban design, industrial design, and data visualization.
Here's an example. And another example.
March 26, 2016 --- I haven't worked on this code for years. This project has been abandoned. It was a neat experiment, but was a clunky implementation and is likely obselete today. Others have written better implementations. For example, the decodes library includes an svg io module.
March 7th, 2012 --- The export now supports arbitrary attributes, giving priority to ids and classes. I tested the attributes to see how well they could handle unicode text, just to be sure it wasn't creating another little ascii unicode death trap. I created a component for inputting css, javascript, and wrapping everything in html. I'm still not sure how NURBS curves should be handled, but for now it will default to approximating them with polylines to an input tolerance (which seems to work pretty well for illustration purposes). The whole thing runs pretty slow. It seemed to break down when writing only about 884 moderately complex polylines.
February 27th, 2012 --- I've now created some simple Dot and Polyline export examples. They are a little slow, but they work fine.
February 5th, 2012 --- I just made this repository for the project, and expect to develop the plugin over the next several months. If you are interested in this project, please 'watch' it here on Github.
Here’s why I think SVG is a good file format to export to: