Plot Alignment Automation
A five-phase Rhino and Grasshopper workflow that reconstructs road terrain, converts CAD elevation annotations into classified points, corrects plot alignment, and generates adjustable transitions between road frontage and flat plot platforms.
From fragmented road contours to coordinated plot levels in Rhino 8, Grasshopper and Python 3. The road engineer’s drawing contained elevation information in two forms: disconnected contour curves and spot levels drawn as symbols beside coloured text. Plot outlines and surfaces were flat. I developed a reusable workflow to connect these inputs, establish each plot’s entrance level, and resolve the transition to the road. The central rule was to control coordinates independently: correct point XY while preserving Z , then raise plots and shape transitions in Z while preserving their footprints . Each phase produces geometry for the next, with explicit review outputs for unresolved cases. Phase 01 — Reconstruct the road terrain The initial audit found 5,381 horizontal contour curves on C-TOPO-MINR-N and C-TOPO-MAJR-N , spanning 20.8–40.1 m. These described the roads; interpolating across the entire drawing would invent terrain through plot interiors. I used the flat Road_Surface as the clipping footprint, retaining 2,036 contour pieces. The script simplifies and samples the curves, triangulates their elevations, interpolates boundary heights, then builds a mesh constrained by the road footprint and its holes. Contours supply sampled height controls; the implemented mesh does not constrain every contour segment as a breakline. The validated mesh preserved 41 boundary loops, including 40 holes. Against the source contours, measured vertical error was 14.5 mm RMS and 100.8 mm maximum . Boundary heights remain interpolated, and the workflow does not invent road crowns or kerb breaklines. The road footprint limits interpolation and preserves the open block interiors. For a cleaner approximation, I added an independent, evenly spaced triangular mesh with subdivision levels 0–4. At level 2, nominal spacing was 4 m and the mesh contained 88,386 triangles. Resampling introduced 13.0 mm RMS and 118.2 mm sampled maximum error relative to the original mesh . These are additional approximation errors, measured against a different reference from the contour checks. Original triangulation: density follows the contour sampling and footprint constraints. Alternate triangulation: more regular interior triangles, with smaller triangles at boundaries. The original mesh was retained and its checksum verified unchanged. Phase 02 — Turn CAD annotations into classified 3D points Each spot-level symbol comprised a circle and two crossing diagonal lines. Its centre supplied XY; the adjacent numeric text supplied absolute Z. The text’s effective object colour supplied the point category. One annotation layer contains multiple point classes. Classification follows the text colour rather than the white marker curves. The solver verifies the crossing lines, extracts the circle centre, and learns the dominant label offset in the text’s local axes, normalised by text height. This layout rule helps distinguish closely spaced labels more reliably than nearest-text matching alone. Ambiguous assignments go to review. P = (marker centre X, marker centre Y, parsed elevation + datum offset) Text colour Point category Unique points in the recorded test Green Road 3,788 Cyan Plot corner 1,164 Yellow Plot centre-back 915 Magenta Plot entrance 916 All 6,784 labels matched. One exact duplicate was merged, producing 6,783 unique points. Records retain source marker IDs, text IDs, colour and elevation so each generated point can be traced to the drawing. Phase 03 — Align points to the plot geometry Some elevated markers were displaced from the actual boundaries. I aligned corner points to meaningful plot vertices, excluding shallow tessellation vertices with direction changes below 10°. Entrance alignment required an additional geometric rule. The solver pairs garage side lines on the same plot, finds their feet on the boundary, and locates the midpoint along the shorter boundary path between them. This keeps entrances on curved frontages. Pair spacing and movement limits are drawing-specific controls. Cyan corners and magenta entrances are aligned in plan. Elevations remain unchanged. The recorded alignment test accepted 1,161 corners and 908 entrances , leaving 11 unresolved points at their original XY. All output Z values matched their source Z exactly. Road and centre-back points passed through unchanged. Phase 04 — Set each plot to its entrance elevation I matched each entrance to a horizontal plot surface using its XY position, including boundary points. Each accepted surface was duplicated and translated vertically: ΔZ = entrance Z − existing plot Z Missing, shared or ambiguous entrance matches are returned for review. The initial corrected component produced 912 raised plots and one review plot; the current diagram definition contains 914 raised plots with no unmatched entrances . These are different input snapshots. Each plot remains horizontal at its entrance datum. The frontage still needs to accommodate the road’s changing elevation. Phase 05 — Build an adjustable frontage transition The transition occupies a user-defined 2–5 m inward XY offset from the frontage. The remainder stays flat at the entrance level. Controls switch between faceted triangular meshes and smooth bicubic NURBS patches; subdivisions 1–10 refine the faceted approximation. Smooth mode uses the cubic patches and required boundary divisions rather than simply subdividing the mesh. In corner-point mode, a piecewise cubic frontage profile passes through corner–entrance–corner elevations. With normalised depth v from 0 at the frontage to 1 at the interior seam, the elevation blend is: S(v) = 3v² − 2v³ Z(u,v) = entrance Z + frontage height difference(u) × [1 − S(v)] The blend returns to the flat interior with a horizontal tangent. The entrance remains fixed, and the original polyline footprint is retained. Folded offset strips and reversed transition cells are rejected. Schematic, not to scale: plan correction preserves elevation; subsequent plot translation and transition shaping preserve XY. An optional road-mesh mode replaces the corner-derived frontage heights with sampled road elevations. It uses vertical intersections where available and otherwise samples the nearest location in the mesh’s XY projection, transferring only Z . The entrance elevation still overrides the road height at the access point. Baked corner-controlled NURBS strips, shown in gold, beside flat plot interiors. Baked road-derived transitions with the reconstructed road mesh. These captures illustrate the saved geometry; they are separate from the historical validation runs below. Recorded configuration Completed / review Corner points · 3 m depth · subdivision 3 904 / 10 Road mesh · 5 m depth · subdivision 3 908 / 6 Current live corner-point preview · 5 m depth · subdivision 1 900 / 14 The historical road-mesh test verified valid faceted meshes, no internal open seams, and control error below the model’s 1 mm tolerance. However, its closest-height fallback had no distance cutoff: two plots sampled across gaps of 7.25 m and 10.79 m . Their elevations remain approximations despite being accepted. The largest entrance-to-mesh difference was 0.256 m, retained as a deliberate entrance override. A repeatable workflow with visible exceptions The result is a sequence of editable layer inputs, Python 3 components, previews and review outputs. Refresh controls reload revised CAD geometry; background workers handle expensive operations; source IDs and per-plot records support checking and downstream baking. An early MeshPatch refinement froze Rhino and required recovery from an autosave. That failure shaped the later workflow: preserve recoverable files, save definitions, work on copied geometry and expose progress before attempting full-model operations. The automation establishes a consistent geometric relationship between road, entrance and plot. Drainage, gradients and engineering acceptance still require separate checks; matching an elevation alone does not establish those outcomes.










