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)
| Key | Description |
|---|---|
sideWall01 | Side wall, height 0.1 |
sideWall03 | Side wall, height 0.3 |
sideWall05 | Side wall, height 0.5 |
sideWall10 | Side wall, height 1.0 |
sideWall50 | Side wall, height 5.0 |
sideWall100 | Side wall, height 10.0 |
rotWall15 | Rotated wall, 15° angle, height 2 |
rotWall30 | Rotated wall, 30° angle, height 2 |
rotWall45 | Rotated wall, 45° angle, height 2 |
rotWall90 | Rotated wall, 90° angle, height 2 |
tube5m | 5m radius tube, half-circle with 1m wall |
tube5mHigh | 5m radius tube with 5m wall extension |
tube5mFull | 5m radius full circle tube |
tube10m | 10m radius tube with 2m wall |
tube10mHigh | 10m radius tube with 10m wall |
tube10mFull | 10m 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 meshtrackBuilder/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