Templates¶
Templates define the theoretical (design) tunnel cross-section shape. Every measured section in TunnelCAD is compared against a template to determine how closely the as-built excavation matches the intended geometry. Deviations from the template produce overbreak and underbreak values that drive volume calculations and compliance analysis.
What is a template?¶
A template is a named collection of one or more template lines, each represented as a polyline with optional arc segments (bulge values). Template lines correspond to Template Line Definitions – named categories such as “Theoretical Excavation”, “Theoretical Lining”, or “Design Invert”. While measured sections use Line Definitions, the design counterpart uses Template Line Definitions to keep the two concepts distinct.
For example, a tunnel design might specify two template lines:
Theoretical Excavation – the outer excavation boundary
Theoretical Lining – the inner finished surface
Each template line is a closed or open polyline that traces the design profile in local section coordinates, where X is the horizontal offset from the alignment axis and Y is the elevation.
Multiple templates per tunnel¶
A single tunnel alignment can contain multiple templates. This is common when the design profile changes along the route – for instance, a wider cross-section in zones of poor geology, a reduced profile in stable rock, or a different shape at portal areas. Each template is a self-contained profile that can be assigned to a chainage range.
Template assignment via Station Definitions¶
Templates are linked to the alignment through Station Definitions, which map chainage ranges to specific templates. When a new cross-section is added at a given station, TunnelCAD looks up the matching station definition and automatically assigns the correct template.
Template transformations¶
Station definitions can specify transitions between two templates over a given length. When a cross-section falls within a transition zone, the template transformation engine automatically computes an interpolated profile by blending the source and destination templates point-by-point.
Two interpolation types are supported:
Linear – uniform blending from source to destination.
Cubic – smoothstep easing (zero velocity at boundaries) for smoother transitions.
The Template Editor includes a transformation preview with a slider to visualize the interpolated profile at any point in the transition zone, and a Check report that diagnoses compatibility issues between the two templates.
See Station Definitions for full details on configuring transitions, and Template Editor for the transformation preview.
Template lines and template line definitions¶
Each template line within a template carries the name of a Template Line Definition. These definitions are configured per tunnel and control the display color and layer of template lines on the canvas. When the Template Editor opens, it automatically synchronizes template lines so that every template contains an entry for every defined Template Line Definition.
Note
Template Line Definitions are separate from the (measured) Line Definitions used for section line data. They are managed in the project tree under each tunnel’s “Template Lines” node.
Arc segments via bulge values¶
Template lines support curved segments through bulge values on individual points. A bulge value of 0 produces a straight segment to the next point, while non-zero values create circular arcs. Positive bulge curves to the right (clockwise) and negative bulge curves to the left (counter-clockwise). The magnitude equals the tangent of one-quarter of the included arc angle.
Important
When editing template points, always set the bulge value after adding the endpoint. The internal bulge array requires at least two points to exist before bulge values can be assigned.