Road Alignment Subsystem
Two special entity families for civil/site geometry: horizontal
alignments with clothoid transitions (CadRPlan*) and vertical profiles
with parabolic curves (CadRProf*).
These reproduce Vecad's road entities. The horizontal geometry uses
true clothoid (Euler-spiral) transitions — not arc approximations — computed
from Fresnel integrals, so stationing, tangent directions and offsets match survey
math.
Horizontal alignment — CadRPlan*
A RoadPlan is a chain of tangents joined by curves. Each curve is a spiral–arc–spiral group defined by a deflection angle, turn direction, radius and the two spiral lengths. yucad places the geometry constructively from a start point, start bearing and start chainage.
YuHandle rp = CadAddRPlan(dwg); CadRPlanSetStart(dwg, rp, x0, y0, startDir, startChainage); /* station, deflection, turn(+1/-1), radius, spiralLen1, spiralLen2 */ CadRPlanAddCurve(dwg, rp, 120.0, angle, +1, 300.0, 60.0, 60.0); CadRPlanUpdate(dwg, rp);
Query the built geometry:
CadRPlanGetPoint— point + tangent angle + side offset at a distance along the alignment.CadRPlanGetNumRecs/ per-record getters — the TS/SC/CS/ST station points, tangent directions, arc center and vertex of each curve.- Ground cross-sections attach with
CadRPlanAddGrSection/CadRPlanAddGrPoint(offset, elevation samples per station). - Per-attribute colour / lineweight / visibility via the eight attribute slots (centerline, spirals, arcs, marks…).
Vertical profile — CadRProf*
A RoadProfile is a series of PVIs (points of vertical intersection), each with a station, elevation and vertical-curve length. Between PVIs the grade is linear; through each PVI a symmetric parabola smooths the grade change.
YuHandle pr = CadAddRProf(dwg); CadRProfAddVer(dwg, pr, station, elevation, curveLen); CadRProfUpdate(dwg, pr); double y = CadRProfGetYnew(dwg, pr, station); /* curved elevation */
CadRProfGetYold— elevation on the straight grade (tangent) at a station;CadRProfGetYnew— elevation on the parabolic curve.CadRProfGetCurvePrm— the BVC/EVC and curve parameters at a PVI.CadRProfGetInterX— grade-intersection station between PVIs.- Independent horizontal/vertical exaggeration scales for drawing the profile.