The output in Grasshopper Rhino of a collection of road outlines as curves

Convert a network of roads into 2D curve plans in Grasshopper

Building on from my Road Maker, where the centrelines of roads can be converted into 2D meshes suitable for rendering more realistic roads in Grasshopper (as done here), a recent task at the office required that these meshes then be turned into a collection of curves marking the outline of the road.

This Grasshopper script enables you to do this, using a couple of standard Grasshopper components. The basic workflow used here is to get a network of roads using Elk and OSM data.

elk-1

The Road Maker then converts this network into 2D meshes. We then extract the mesh edges and then use the RUnion to tidy it up as much as possible. The final result isn’t perfect but should minimise the amount of manual work needed at the end.

elk-2

We should then get a result that looks like:

road-network-curves-grasshopper

3 thoughts on “Convert a network of roads into 2D curve plans in Grasshopper”

  1. Hi, im having trouble with this, i keep getting
    1. Object reference not set to an instance of an object. (line: 75)
    Can you help me please? Is the last piece missing

    1. Hi Ariel, it could be because you’re trying to input curves? The component only accepts polylines. Try converting it to a polyline first.

      The reason it accepts polylines was because I wrote the component to convert road centrelines from OpenStreetMap data to 2D shapes. OpenStreetMap roads are supplied as polylines.

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: