A Plugin for exporting geometry from Grasshopper/Rhino to SVG data format
HTML Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
tests
.gitignore
README.md
circles_sample.png
dynamic_example.html
polylines_sample.png
svg-export.py
svg_circles_example.ghx
svg_circles_example.svg
svg_polylines_example.gh
svg_polylines_example.svg
test.svg

README.md

#gh-svg


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.

The Current State of this Software

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.

Next Steps to Development

  • Point/Dot Export (Done!)
  • Polylines Export (Done!)
  • Viewport Projection (Done!)
  • Embedding arbitrary attributes (Done!)
  • Viewport Selection (ok, soon)
  • Curve Export (no beziers yet, but polyline approximation works)

But why?

Here’s why I think SVG is a good file format to export to:

  1. SVG can be read by any common browser, and therefore there is no need for special software to view it.
  2. SVG can be easily read and edited by most vector editing software, including Adobe Illustrator and many open source softwares. style information can be easily embedded in the geometry, or can be adjusted with a style sheet
  3. SVG is dynamic. This means I can create geometry with Rhino with embedded hypertext links, or I can use Javascript to display information when someone hovers their mouse over the geometry.