RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Editor AI TestsEditor AI VisualizationEditor – Assembly Spline ToolAsset BrowserAsset DeduplicatorAsset Management ToolSFX Previewer (Audio Events List)Audio Ribbon EditorAutoSaveBarriers EditorBiome ToolBuilding EditorBulk RenameCamera BookmarksCamera TransformCamera Path EditorCEF HelperCo-Simulation Signal EditorCrawl Data EditorCreate Object ToolDataBlock EditorDecal EditorDecal Spline EditorDocumentation HelperDrag Race EditorDrift Data EditorDrive Path EditorDynamic Decals Tool (Vehicle Livery Creator)Engine Audio DebugExtensions DebugExtensions EditorFFI Pointer Leak TestFile DialogFlowgraph EditorForest EditorForest ViewEditor Gizmo HelperEditor Ground Model Debug HelperEditor Headless Editor TestEditor Icon OverviewEditor ImGui C DemoEditor InspectorEditor Layout ManagerEditor Level SettingsEditor Level ValidatorEditor LoggerEditor Log HelperEditor MainEditor Main MenuEditor Main ToolbarEditor Main UpdateMap Sensor EditorMaster Spline EditorMaterial EditorMeasures Inspector HeaderMesh Editor (Base)Mesh Road EditorMesh Spline EditorMission EditorMission PlaybookMission Start Position EditorMulti Spawn Manager (Vehicle Groups)Navigation Mesh EditorEditor News MessageObject Tool (Object Select Edit Mode)Object To Spline EditorParticle EditorPerformance Profiler / Camera RecorderPhysics ReloaderPrefab Instance EditorEditor PreferencesRace / Path EditorRally EditorRaycast Test Editor ToolRenderer Components Editor ToolRender Test Editor ToolResource Checker Editor ToolRiver EditorRoad Architect EditorRoad DecorationsRoad Editor (Decal Road)Road Network ExporterRoad River Cache HandlerRoad River GUIRoad Spline EditorRoad Template EditorRoad UtilitiesScene TreeScene ViewScreenshot Creator BootstrapScript AI EditorScript AI ManagerSensor Configuration EditorSensor DebuggerShape EditorShortcut LegendSidewalk Spline EditorSites EditorSlot Traffic EditorSuspension Audio DebugTech Server ManagerTerraform ToolTerrain And Road ImporterTerrain EditorTerrain Materials EditorText EditorTool ManagerTool ShortcutsTraffic DebugTraffic ManagerTraffic Signals EditorUndo History ViewerVehicle Bridge TestVehicle Detail ViewerVehicle Editor MainEditor - VisualizationEditor Viz HelperEditor Water Object HelperEditor Windows Manager
Road Architect - ClothoidRoad Architect - DecalsRoad Architect - ExportRoad Architect - GeometryRoad Architect - GroupsRoad Architect - ImportRoad Architect - JunctionsRoad Architect - LinkRoad Architect - OverlaysRoad Architect - ProfilesRoad Architect - RenderRoad Architect - Road MeshRoad Architect RoadsRoad Architect - Static MeshRoad Architect - Static Mesh ManagerRoad Architect - TerraformRoad Architect - Tunnel MeshRoad Architect Utilities

UI

Resources

BeamNG Game Engine Lua Cheat SheetGE Developer RecipesMCP Server Setup

// RLS.STUDIOS=true

Premium Mods for BeamNG.drive. Career systems, custom vehicles, and immersive gameplay experiences.

Index

HomeProjectsPatreon

Socials

DiscordPatreon (RLS)Patreon (Vehicles)

© 2026 RLS Studios. All rights reserved.

Modding since 2024

API ReferenceGE ExtensionseditortechroadArchitect

Road Architect - Road Mesh

Generates procedural meshes for roads including sidewalks, curbs, and bridges using the Road Architect system.

Generates procedural meshes for roads including sidewalks, curbs, and bridges using the Road Architect system.


Module Overview

editor/tech/roadArchitect/roadMesh creates ProceduralMesh objects for road surfaces, sidewalk/curb pairs, and bridges. It handles vertex generation, UV mapping, face construction, normals, and end caps.


Public API

FunctionSignatureDescription
M.createRoad(r, roadMeshIdx, folder)Creates all procedural meshes for a road (sidewalks+curbs per section)
M.tryRemove(roadName)Removes all meshes for the given road name from the scene
M.updateBridge(r, folder)Creates/updates a bridge procedural mesh for the given road
M.tryRemoveBridge(roadName)Removes the bridge mesh for the given road name
M.clearBridges()Clears the internal bridges structure

Key Internals

ItemDescription
computeSections(r)Identifies lateral sections of road by lane type (road_lane, sidewalk)
createLeftSidewalkKerbBuilds left-facing sidewalk + curb procedural mesh with end caps
createRightSidewalkKerbBuilds right-facing sidewalk + curb procedural mesh with end caps
materialsDefault material table: m_asphalt_new_01, slabs_large, m_sidewalk_curb_trim_01

Code Example

local roadMeshMgr = require('editor/tech/roadArchitect/roadMesh')

-- Create procedural meshes for a road inside a scene folder
local folder = createObject("SimGroup")
folder:registerObject("Road Architect - Road 1")
scenetree.MissionGroup:addObject(folder)

roadMeshMgr.createRoad(road, 1, folder)

-- Create a bridge mesh
roadMeshMgr.updateBridge(bridgeRoad, folder)

-- Remove all meshes for a road
roadMeshMgr.tryRemove(road.name)

-- Remove a bridge
roadMeshMgr.tryRemoveBridge(road.name)

-- Clear all bridges
roadMeshMgr.clearBridges()

-- Mesh structure internals:
-- Each ProceduralMesh is created with:
--   surfaceMesh = { verts, faces, normals, uvs, material }
--   endCaps     = { verts, faces, normals, uvs, material }
-- The mesh is registered, placed at origin, with scale = vec3(1,1,1)

-- Bridge mesh uses ring topology:
-- 1. Compute ring of points around cross-section (top + bottom face vertices)
-- 2. Extrude along road length with parabolic arch: dZ = -4*(h+d)*q^2 + 4*(h+d)*q - d
-- 3. Add end caps for each lane pair

-- UV mapping for sidewalks uses kerb-specific v-ranges:
-- kVStart is based on profile vStart, scaled by 0.2
-- Each curb sub-section uses v offsets of 0.1 with a small gap (kerbVGap = 0.00332)

-- Ray casting is used to snap sidewalk vertices to terrain:
-- p.z = p.z - castRayStatic(p, downVec, 1000)
-- A "raised" offset of vec3(0,0,4.5) is applied before casting

Dependencies

ModulePurpose
editor/tech/roadArchitect/utilitiesslerp, misc utilities

See Also

  • Road Architect - Clothoid - Related reference
  • Road Architect - Decals - Related reference
  • Road Architect - Export - Related reference
  • World Editor Guide - Guide

Road Architect - Render

Handles all editor viewport rendering for the Road Architect. Draws road surfaces, outlines, centerlines, lane numbering, direction arrows, node spheres, guidelines, layer visualizations, junctions, l

Road Architect Roads

- `M.addIntermediateNode`

On this page

Module OverviewPublic APIKey InternalsCode ExampleDependenciesSee Also