Editor Tool Utilities – Road Design Standards
Provides preset road design standards for homologation analysis. Each preset defines maximum slope, minimum curve radius, maximum banking, and width gradient tolerances.
Provides preset road design standards for homologation analysis. Each preset defines maximum slope, minimum curve radius, maximum banking, and width gradient tolerances.
Public API
| Function | Signature | Description |
|---|---|---|
M.getPresetStrings | () → table | Returns ordered array of preset name strings |
M.getPresetsMap | () → table | Returns map of preset name → parameter table |
Presets
| Preset | maxSlope | minRadius (m) | maxBanking (°) | maxWidthGradient |
|---|---|---|---|---|
| Freeway / Autobahn | 0.04 | 500 | 5 | 0.02 |
| Major Rural Road | 0.06 | 200 | 7 | 0.03 |
| Secondary Road | 0.08 | 100 | 9 | 0.05 |
| Mountain Pass | 0.12 | 40 | 12 | 0.07 |
| Unpaved Trail | 0.18 | 20 | 14 | 0.10 |
| Off-Road / F-Road | 0.24 | 12 | 18 | 0.12 |
Code Examples
local standards = require('editor/toolUtilities/roadDesignStandards')
-- Get available preset names
local names = standards.getPresetStrings()
-- {"Freeway / Autobahn", "Major Rural Road", "Secondary Road", ...}
-- Look up a specific preset
local presetsMap = standards.getPresetsMap()
local freeway = presetsMap["Freeway / Autobahn"]
log('I', 'road', string.format(
'Freeway: maxSlope=%.2f, minRadius=%.0fm, maxBank=%.0f°',
freeway.maxSlope, freeway.minRadius, freeway.maxBanking))
-- Use in a combo box for road type selection
for i, name in ipairs(names) do
local preset = presetsMap[name]
-- Compare spline analysis metrics against preset thresholds
if splineSlope > preset.maxSlope then
log('W', 'road', name .. ' slope violation at segment ' .. segIdx)
end
endSee Also
- Tool Utilities - Fit Polyline - Related reference
- Editor Tool Utilities – Geometry - Related reference
- Editor Tool Utilities – Gizmo - Related reference
- World Editor Guide - Guide
Editor Tool Utilities – Riverbed Terraforming
Terraforms terrain beneath a spline to create riverbeds. Modifies terrain heightmap using cross-sectional depth profiles with bank sharpness, smoothing, and revert support.
Editor Tool Utilities – Simplex Noise
2D Simplex noise implementation with a static permutation table. Provides smoother, less grid-aligned noise compared to Perlin noise, with O(n²) complexity for n dimensions.