RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

server/commands - Camera & Input Commandsge_utils - Game Engine Utility Functionsmain.lua - GE Lua Entry Point & Game Loopmap.lua - Navigation Graph (AI Road Map)screenshot.lua - Screenshot Systemserver/server - Level Loading & Game ServerserverConnection - Client-Server Connection Manager`setSpawnpoint` - Default Spawn Point Persistence`simTimeAuthority` - Simulation Time & Bullet Time Control`spawn` - Vehicle Spawning & Safe Placement`suspensionFrequencyTester` - Suspension Natural Frequency Analysis
Auto AnnotationBoosterCalibrate ESCCompile ImpostersCompile MeshesConfig List GeneratorDecal Roads EditorDependency TreeDoc CreatorExport (glTF)Follow The White RabbitForest GeneratorGround Model DebugInput System UtilsInstanced Line Render DemoJBeam StatsLog StreamsMap TilesNode Beam ExportNode StreamPhotomodePrecompile ShadersPrecompile VehiclesProcedural Track (Gymkhana Generator)Rectangle GeneratorRender Components APIResave MaterialsRich PresenceSave Dynamic DataScreenshot Creator (Vehicle Thumbnails)ShowroomSort LinesStep HandlerTerrain GeneratorTest Extension ProxiesTest JSON Files Syntaxutil/vehicleRopeDebug - Rope Physics Debug UIutil/worker - Batch Job Workerutil/wsTest - WebSocket Test Server
Track Builder - Basic BordersTrack Builder - Basic CentersTrack Builder - Border Wall MeshTrack Builder - Camera TransitionTrack Builder - Ceiling MeshtrackBuilder/markers - Track Marker Interpolation & VisualizationtrackBuilder/materialUtil - Track Material ManagementtrackBuilder/meshes - Cross-Section Mesh DefinitionstrackBuilder/multiTrackMerger - Track Intersection MergingtrackBuilder/obstaclePlacer - Track Obstacle PlacementtrackBuilder/pieces - Track Piece Geometry GenerationtrackBuilder/proceduralPrimitives - Procedural 3D Primitive GeneratorstrackBuilder/quickraceSetup - Quick Race Track LoadertrackBuilder/segmentToProceduralMesh - Segment Mesh GeneratortrackBuilder/splineTrack - Main Track Builder 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 ExtensionsutiltrackBuilder

trackBuilder/meshes - Cross-Section Mesh Definitions

Reference for `extensions/util/trackBuilder/meshes.lua`. Defines cross-section profiles (tubes and side walls) used by the track builder's procedural mesh system.

Reference for extensions/util/trackBuilder/meshes.lua. Defines cross-section profiles (tubes and side walls) used by the track builder's procedural mesh system.


Exports (returned table)

KeyDescription
sideWall01Side wall, height 0.1
sideWall03Side wall, height 0.3
sideWall05Side wall, height 0.5
sideWall10Side wall, height 1.0
sideWall50Side wall, height 5.0
sideWall100Side wall, height 10.0
rotWall15Rotated wall, 15° angle, height 2
rotWall30Rotated wall, 30° angle, height 2
rotWall45Rotated wall, 45° angle, height 2
rotWall90Rotated wall, 90° angle, height 2
tube5m5m radius tube, half-circle with 1m wall
tube5mHigh5m radius tube with 5m wall extension
tube5mFull5m radius full circle tube
tube10m10m radius tube with 2m wall
tube10mHigh10m radius tube with 10m wall
tube10mFull10m radius full circle tube

This module returns a plain table (not M), so it's used via require() not as an extension.


Internals

createTube(radius, steps, wallHeight)

Generates a tube cross-section with inner and outer shell. Uses trigonometric sampling around a semicircle or full circle. Includes optional vertical wall extension above the tube opening. Returns {crossPoints, uv, cap, material, flipUVRight}.

createSideWall(height, angle)

Creates a simple triangular wall profile. The angle parameter tilts the wall inward. Returns the same cross-section format with sharp edges flagged.


How It Works

Each mesh definition is a cross-section profile containing:

  • crossPoints: vec3 positions defining the 2D cross-section shape
  • uv: Per-point UV channel (0 for outer surface, 1 for inner)
  • cap: Triangle face indices for end caps
  • material: Always "track_editor_border"
  • sharp: Indices where normals should not be smoothed (walls only)
  • flipUVRight: UV orientation flag

The track builder extrudes these profiles along spline paths to create the 3D track geometry.

local meshes = require('util/trackBuilder/meshes')
local tube = meshes.tube5m
-- tube.crossPoints contains vec3 positions for the cross-section
-- Used by segmentToProceduralMesh to generate the final 3D mesh

trackBuilder/materialUtil - Track Material Management

Reference for `extensions/util/trackBuilder/materialUtil.lua`. Manages track surface materials (colors, textures, glow, ground type) for the 8 material slots (A–H) used by the track editor.

trackBuilder/multiTrackMerger - Track Intersection Merging

Reference for `extensions/util/trackBuilder/multiTrackMerger.lua`. Creates procedural meshes at intersection points where multiple track segments meet, filling the gaps with bezier-interpolated surfac

On this page

Exports (returned table)InternalscreateTube(radius, steps, wallHeight)createSideWall(height, angle)How It Works