yucad3d

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:

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 */