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
Terraform - Fetch SourcesTerraform - Core Engine

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 Extensionseditorterraform

Terraform - Fetch Sources

Collects terraforming sources (roads, splines) from the scene within a polygon or selection, converting them to a standardized format for the terraform engine.

Collects terraforming sources (roads, splines) from the scene within a polygon or selection, converting them to a standardized format for the terraform engine.


Public API

FunctionSignatureDescription
M.getAllSourcesInPolygon(polygon) → sourcesGets all supported sources within a polygon
M.getAllSourcesInSelection() → sourcesGets all supported sources in current editor selection

Source Types Collected

Source TypeModule UsedDescription
MeshRoadscenetree.findClassObjects("MeshRoad")Scene tree mesh roads
RAT Roadseditor/tech/roadArchitect/roadsRoad Architect roads
Mesh Splineseditor/meshSpline/splineMgrMesh spline tools
Assembly Splineseditor/assemblySpline/splineMgrAssembly spline tools
Master Splineseditor/masterSpline/splineMgrMaster spline tools

Code Example

local fetchSources = require('editor/terraform/fetchSources')

-- Get all sources within a drawn polygon
local polygon = { vec3(0,0,0), vec3(100,0,0), vec3(100,100,0), vec3(0,100,0) }
local sources = fetchSources.getAllSourcesInPolygon(polygon)

-- Get sources from editor selection (MeshRoads only)
local sources = fetchSources.getAllSourcesInSelection()

-- Each source is an array of ordered polyline points:
-- { pos = vec3, width = number, binormal = vec3 }

-- For mesh roads, a Catmull-Rom spline is fitted to nodes
-- with Frenet frame computation (tangent, normal, binormal)

-- For RAT roads, render data is used directly with lane extents

-- Polygon clipping: roads partially inside are split,
-- only segments inside the polygon are included as separate sources

-- AABB pre-filtering: sources outside polygon AABB are skipped
-- Node spans computed via geom.getNodeSpansInsidePolygon()

Dependencies

ModulePurpose
editor/meshSpline/splineMgrMesh spline data access
editor/assemblySpline/splineMgrAssembly spline data access
editor/tech/roadArchitect/roadsRAT road data access
editor/masterSpline/splineMgrMaster spline data access
editor/toolUtilities/geomPolygon/AABB/span geometry utilities

See Also

  • Terraform - Core Engine - Related reference
  • World Editor Guide - Guide

Sensor Configuration - Utilities

Provides coordinate frame conversions between vehicle-space and sensor-local frames, plus debug visualization for sensor boxes, beams, and local frames.

Terraform - Core Engine

Core terraforming engine that modifies terrain heightmaps based on source geometry (roads, splines) using SDF-based falloff, optional noise, and blur smoothing.

On this page

Public APISource Types CollectedCode ExampleDependenciesSee Also