RLS Studios
ProjectsPatreonCommunityDocsAbout
Join Patreon
BeamNG Modding Docs

Guides

Reference

Server CommandsGE UtilitiesGame Engine MainNavigation GraphScreenshot CaptureServerServer ConnectionSpawnpoint ManagerSimulation TimeVehicle SpawningSuspension Frequency Tester
Auto AnnotationBoosterCalibrate ESCCompile ImpostersCompile MeshesConfig List GeneratorDecal Roads EditorDependency TreeDoc CreatorVehicle ExporterFollow The White RabbitForest GeneratorGround Model DebugInput System UtilsInstanced Line Render DemoJBeam StatsLog StreamsMap TilesNode Beam ExportNode StreamPhotomodePrecompile ShadersPrecompile VehiclesProcedural Track GeneratorRectangle GeneratorRender Components APIResave MaterialsRich PresenceSave Dynamic DataScreenshot CreatorShowroomSort LinesStep HandlerTerrain GeneratorTest Extension ProxiesTest JSON Files SyntaxVehicle Rope DebugBatch WorkerWebSocket Test
Basic BordersBasic CentersBorder Wall MeshCamera TransitionCeiling MeshTrack MarkersMaterial UtilTrack MeshesMulti Track MergerObstacle PlacerTrack PiecesProcedural PrimitivesQuickrace SetupSegment To Procedural MeshSpline Track

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

Track Meshes

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

See Also

  • Track Builder - Basic Borders - Related reference
  • Track Builder - Basic Centers - Related reference
  • Track Builder - Border Wall Mesh - Related reference
  • Game Engine Overview - Guide

Material Util

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.

Multi Track Merger

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 WorksSee Also