UrbanDesign4Rhino¶
Urban-scale design tools — OpenStreetMap data import, terrain operations, road generation, 3D building extrusion, and land-use colour management.
Folder structure required
This plugin depends on scripts in assets/ (e.g. osm_utilities.py, osm_parser.py, default_conditions.py). Keep the full folder structure intact.
OSM Import & Coordinate System¶
knOSMImport¶
Imports an OpenStreetMap .osm XML file and creates polyline geometry for all OSM ways (roads, buildings, parks, water bodies, etc.), organised onto named layers according to tag conditions.
| Property | Detail |
|---|---|
| Input | File open dialog — select a .osm file |
| Output | Polyline curves on categorised layers (e.g. URBAN2D::roads, URBAN2D::buildings) with OSM tags stored as object user text |
Note
Uses Mercator projection. Multipolygon relations are grouped. Empty layers are purged after import.
knOSMtransformtorigin¶
Transforms all model objects from OSM Mercator world-space to a local coordinate system centred at a user-defined origin plane. Stores the transformation matrix in document user text for later reversal.
| Property | Detail |
|---|---|
| Input | Pick a 3-point reference plane (or reuses stored matrix if run again) |
| Output | All objects moved to local coordinates; transformation matrix and geo-located origin saved |
knOSMtransformtoworld¶
Reverses a previously stored local-to-world transformation, returning all model objects to OSM Mercator world coordinates.
| Property | Detail |
|---|---|
| Input | None — reads stored Transformation Matrix from document user text |
| Output | All objects returned to global/world coordinates |
Warning
Requires a prior run of knOSMtransformtorigin. Fails if no matrix is stored.
3D Buildings¶
knOSM3d¶
Extrudes 2D building footprint curves (from the URBAN2D::buildings layer) into 3D building masses. Uses the building:levels user text on each curve to determine height per floor.
| Property | Detail |
|---|---|
| Input | Eto form: Level Height (model units) |
| Output | Capped extrusion BREPs on the URBAN3D::buildings layer; OSM user text transferred from source curves |
Note
Prompts to delete existing 3D buildings if the URBAN3D::buildings layer already has geometry.
Roads¶
knDrawRoad¶
Interactively draws a road surface by picking a centreline polyline. Width and corner radius are set via an Eto form.
| Property | Detail |
|---|---|
| Input | Eto form: Road Width, Corner Radius; pick centreline points |
| Output | Closed planar road-footprint surface |
Warning
Self-intersecting centrelines are rejected with a message.
knRoadfromCrv¶
Creates road surfaces from existing centreline curves by offsetting and filleting them. Similar to knDrawRoad but works on pre-drawn curves.
| Property | Detail |
|---|---|
| Input | Eto form: Road Width, Corner Radius; select existing curves |
| Output | Planar road surface(s); input curves deleted |
knCurveBooleanUnion¶
Performs a curve boolean union on the border curves of selected surfaces, then creates merged planar surfaces from the result.
| Property | Detail |
|---|---|
| Input | Select 2 or more surfaces |
| Output | New merged planar surface(s); original curves and surfaces deleted |
Note
The registered command name is knSrfBooleanUnion — use this in the Rhino command line.
Terrain¶
knProjectSrftoTerrain¶
Drapes selected flat surfaces onto a terrain mesh or polysurface by ray-casting each control point to find the terrain intersection, then creates a conforming patch.
| Property | Detail |
|---|---|
| Input | Select source surfaces; select terrain (mesh or polysurface) |
| Output | New patch surface conforming to terrain profile |
Note
Converts mesh terrain to NURBS internally for ray-shooting. Edge cases where rays miss are snapped to the closest terrain point.
knDropObjectstoTerrain¶
Moves selected polysurface objects down to Z = 0 by computing the lowest face centroid and translating accordingly.
| Property | Detail |
|---|---|
| Input | Select polysurface objects (preselect supported) |
| Output | Objects translated so their lowest face sits at Z = 0 |
Land-Use Colours¶
knCreateColorsforUses¶
Opens a modeless Eto colour-management form to define and manage land-use types, each with a name and a colour swatch. Type→colour mappings are stored as document user text (URBAN3D::Type::*) and can be applied directly to tagged objects.
| Property | Detail |
|---|---|
| Input | Interactive form: add/remove/rename types, pick colours, assign objects via the + button |
| Output | Type→colour mappings stored in document user text; "Display in 3D" button applies colours to tagged objects |
First-run behaviour
On first run, a default colour palette is initialised. Run the command again to customise.
Layer Reference¶
| Layer | Contents |
|---|---|
URBAN2D::buildings |
2D building footprint curves from OSM import |
URBAN2D::roads |
2D road curves from OSM import |
URBAN3D::buildings |
3D extruded building masses |
URBAN3D::* |
Other 3D urban elements |
Default / others |
All other OSM categories per default_conditions.py |