Road Architect - Clothoid
Provides clothoid (Euler spiral) fitting for road nodes. Computes smooth curvature-continuous transitions between road segments using Fresnel integrals, with support for arc length parameterization an
Provides clothoid (Euler spiral) fitting for road nodes. Computes smooth curvature-continuous transitions between road segments using Fresnel integrals, with support for arc length parameterization and lateral offset computations.
Public Functions
| Function | Signature | Description |
|---|---|---|
M.evaluate | (...) | Evaluates clothoid curve |
Example: Clothoid Curve Fitting
local clothoid = require('editor/tech/roadArchitect/clothoid')
-- Fit a clothoid through three road nodes
local p1 = vec3(0, 0, 0)
local p2 = vec3(50, 30, 0)
local p3 = vec3(100, 10, 0)
local hdg1 = clothoid.computeHeading(p1, p2)
local hdg2 = clothoid.computeHeading(p2, p3)
local cData = clothoid.fitClothoid(p1, p2, p3, hdg1, hdg2)
-- Sample the clothoid into a polyline (100 points)
local polyline = clothoid.computeClothoidPolyline(cData, 100)
-- Get arc length
local length = clothoid.getClothoidLength(cData)
-- Compute a point offset laterally (e.g., lane edge)
local offsetPt = clothoid.clothoidLateralOffset(cData, length * 0.5, 3.5)
-- Fresnel integral for custom calculations
local S, C = clothoid.fresnelIntegral(1.0, 10)Notes
- Clothoids provide curvature-continuous transitions (no sudden steering changes)
- Used internally by the road geometry module for smooth road curves
- Fresnel integrals computed via truncated power series (configurable terms)
Functions
evaluate(start, theta0, kappa, dKappa, p)
Handles evaluate.
start(any)theta0(any)kappa(any)dKappa(any)p(any)
Returns: self
Functions
evaluate(start, theta0, kappa, dKappa, p)
Handles evaluate.
start(any)theta0(any)kappa(any)dKappa(any)p(any)
Returns: self
See Also
- Road Architect - Decals - Related reference
- Road Architect - Export - Related reference
- Road Architect - Geometry - Related reference
- World Editor Guide - Guide
Sites Editor - Zones
Sub-editor for managing zone polygon elements within the Sites Editor. Supports vertex selection/manipulation, plane editing, terrain snapping, and polygon-based containment testing.
Road Architect - Decals
Manages road surface decals (lane markings, arrows, patches) for the Road Architect. Creates, positions, and manages DecalRoad and MeshRoad Torque objects along lane edges and surfaces.