Road Architect - Geometry
Core geometry module for the Road Architect. Computes road meshes from node chains using Catmull-Rom spline interpolation, lateral offset sampling, elevation blending, and procedural mesh generation.
Core geometry module for the Road Architect. Computes road meshes from node chains using Catmull-Rom spline interpolation, lateral offset sampling, elevation blending, and procedural mesh generation. Handles terrain conformity, bridges, and tunnel geometry.
Public Functions
| Function | Signature | Description |
|---|---|---|
M.computeRoadRenderData | (...) | Computes road mesh render data from node chains |
Example: Road Geometry Pipeline
local geometry = require('editor/tech/roadArchitect/geometry')
-- Step 1: Compute render data (spline sampling, lateral offsets)
geometry.computeRoadRenderData(road)
-- Step 2: Create the procedural mesh from render data
geometry.createRoadMesh(road)
-- When nodes change, mark dirty and re-update
geometry.setGeometryDirty(road)
geometry.tryUpdateGeometry(road)
-- Batch update multiple roads
geometry.computeRoadRenderDataMulti(roads)
-- Conform road to terrain (e.g., after terrain edit)
geometry.conformToTerrain(road, road.renderData)
-- Bridge-specific geometry
geometry.computeBridgeGeometry(road)
-- Tunnel geometry around a road section
geometry.computeTunnelGeometry(road, road.tunnels[1])
-- Granularity presets control mesh density:
-- "Low", "Medium", "High", "Ultra"
local opts = geometry.getGranularityOptions()Notes
- Uses Catmull-Rom splines with configurable tension per node
- Lateral profiles define lane widths, shoulders, and curbs
- Terrain conformity uses ray-casting and smooth blending
- Bridge geometry includes deck, railings, and support columns
- Procedural meshes created as ProceduralMesh Torque objects
See Also
- Road Architect - Clothoid - Related reference
- Road Architect - Decals - Related reference
- Road Architect - Export - Related reference
- World Editor Guide - Guide
Road Architect - Export
Handles serialization and export of Road Architect road data to JSON files. Converts road structures (nodes, profiles, layers, groups, junctions, overlays) into a portable format.
Road Architect - Groups
Manages road groups in the Road Architect. Groups allow batch operations (terraforming, visibility, profiles) across multiple roads defined by a perimeter polygon or manual selection.