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 Spline Group ManagerRoad Spline ImportRoad Spline Layer Manager

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 ExtensionseditorroadSpline

Road Spline Import

Handles importing DecalRoad objects into road spline groups - supports both direct selection and polygon-based selection, computing reference splines and relative layer properties.

Handles importing DecalRoad objects into road spline groups - supports both direct selection and polygon-based selection, computing reference splines and relative layer properties.


Public API

FunctionSignatureDescription
M.importSelectedIntoNewGroup(decalRoads)Imports selected DecalRoad objects into a new road spline group
M.importFromPolygon(polygon)Finds all DecalRoads with nodes inside the polygon and imports them

Import Pipeline

  1. Backup selected DecalRoads for undo restoration
  2. Compute reference spline - estimates the centerline by finding edges of the combined DecalRoad selection using exponential + binary search
  3. Create layers from each DecalRoad relative to the reference spline (lateral offset, width tracking, flip detection)
  4. Simplify the reference spline using RDP algorithm
  5. Delete the original DecalRoad objects (restoreable via undo)

Key Internal Functions

FunctionPurpose
computeReferenceSpline(decalRoads)Computes centerline by edge-finding along the longest road's polyline
createLayersFromDecalRoads(decalRoads, refNodes, refWidths)Creates layers with computed lateral offset, flip, and track-width flags
findEdgeDistance(origin, dir, numDecalRoads)Binary search for polygon edge distance along a direction
backupDecalRoads(decalRoads)Creates restorable backup data for undo operations

Usage Example

-- Import via polygon selection (used by the road spline tool's polygon mode):
local polygon = { vec3(0,0,0), vec3(100,0,0), vec3(100,100,0), vec3(0,100,0) }
extensions.editor_roadSpline_import.importFromPolygon(polygon)

-- Import specific DecalRoad objects:
local roads = { scenetree.findObject("myRoad1"), scenetree.findObject("myRoad2") }
extensions.editor_roadSpline_import.importSelectedIntoNewGroup(roads)

Notes

  • Uses exponential expansion + binary refinement (8 iterations) for edge finding
  • Maximum search distance: 50m laterally
  • Flip detection uses majority-vote dot product comparison
  • Width tracking tolerance: 0.1m

Functions

importFromPolygon(polygon)

Imports from polygon.

  • polygon (any)

Returns: self

importFromPolygon(polygon)

Imports from polygon.

  • polygon (any)

Returns: self

Functions

importFromPolygon(polygon)

Imports from polygon.

  • polygon (any)

Returns: self

importFromPolygon(polygon)

Imports from polygon.

  • polygon (any)

Returns: self


See Also

  • Road Spline Group Manager - Related reference
  • Road Spline Layer Manager - Related reference
  • World Editor Guide - Guide

Road Spline Group Manager

Backend manager for road spline groups - handles creation, removal, splitting, joining, serialization, terrain painting, and undo/redo operations.

Road Spline Layer Manager

Manages the DecalRoad layers within road spline groups - handles layer creation, removal, duplication, chunking for long splines, and all auto-generated detail layer types.

On this page

Public APIImport PipelineKey Internal FunctionsUsage ExampleNotesFunctionsimportFromPolygon(polygon)importFromPolygon(polygon)FunctionsimportFromPolygon(polygon)importFromPolygon(polygon)See Also