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.
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.
We should then get a result that looks like:
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
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.
hi james, can i make roads with different widths?
-Rison