Feature-Based Grading Tool: Grade to Distance, Elevation & Relative Height
The Linear Grading command in SPCAD allows you to grade daylight from a selected linear feature, such as a polyline, 3D polyline, line, or arc-tessellated polyline. The tool supports three main grading workflows:
- Grade to Distance – Offset a fixed horizontal distance from the base feature.
- Grade to Elevation – Grade until a fixed target elevation is reached.
- Grade to Relative Elevation – Grade to a constant vertical offset from the feature (e.g., +2.5 m above or −1.2 m below).
Outputs include daylight points, optional daylight linework, and a triangle strip (TIN faces) connecting the base and the daylight.
Overview
1- Feature-Based Grading Tool: Selecting Features & Range
- Click Select… and pick a polyline/3D polyline (open or closed).
- LWPOLYLINE bulges (arcs) are respected via tessellation.
- 3D Polylines use their existing vertices.
- (Optional) Apply to the entire length
- Checked: grading is computed along the whole feature.
- Unchecked: a sub-length jig starts:
- Pick a start point on the feature.
- Move the cursor along the feature to preview the graded span (blue preview).
- Press Enter to accept, or type E to grade the entire length.
Tip: The jig works on both Polyline and 3D Polyline. When a WPF window is open, SPCAD uses EditorUserInteraction so clicks go to CAD as expected.
2- Common Grading Options
- Grading side: Left or Right relative to the feature direction (vertex order).
If the daylight looks “inside-out”, reverse the polyline or switch sides. - Grading Surface Name: Name used for the new graded TIN metadata and visualization.
- Draw Day Light Line: Adds a 3D polyline through daylight points (good for QA or styling).
3- Feature-Based Grading Tool Modes & Parameters
A) Grade to Distance
Offset a constant horizontal distance and apply a single slope.
- Distance (H): positive, non-zero.
- Cut slope (H:V) fields are hidden in this mode; you enter one slope H:V:
- SPCAD uses V/H internally (rise over run).
- Direction of grade (up/down): Use the sign on V to control fall when needed.
- Example: H=1, V=2 → grades up 2:1.
- H=1, V=-2 → grades down 2:1 (daylight Z lower than base).
Behavior:
- The software computes the daylight by offsetting the feature by Distance on the chosen side.
- The program automatically fillets concave corners on the chosen side (arc-approx) using a radius equal to the offset distance. This step prevents self-intersections.
- The system calculates Daylight Z from the base Z ± (ΔH × slope).
Good to know:
- Use positive H. Use negative V only when you want explicit “downward” grading.
- If the offset distance is very small at a very sharp corner, SPCAD will clamp the fillet to fit the segments, keeping the daylight valid.
B- Grade to Elevation
Grade from the base to a fixed target elevation using separate cut & fill slopes.
- Target elevation: absolute elevation to hit.
- Cut slope (H:V) and Fill slope (H:V): positive values (H>0, V>0).
- SPCAD chooses which slope to use at each vertex/segment based on whether the target lies below (cut) or above (fill) the base.
Behavior:
- The system logically splits the base where it crosses the target plane to prevent slopes from “flipping” mid-segment.
- The software computes the horizontal distance to the daylight for each vertex: |ΔZ| / (V/H).
- It applies variable-radius fillets to concave corners on the chosen side, using the per-vertex distance. This prevents the “pinch” that appears at bends.
- The program lifts daylight points to Z = Target elevation.
- It builds triangles for each base segment (without using CDT), avoiding crossing or missing faces.
Tips:
- If the daylight touches the base at a vertex (because base Z = target Z), you’ll still get valid triangulation; the fan method handles degenerate spans.
- If you expected a fillet but see a sharp corner, check that the radius implied by |ΔZ|/(V/H) is not effectively zero at that vertex.
C- Grade to Relative Elevation
Grade to a constant vertical offset from the base (e.g., berm or swale).
- Relative elevation: positive means raise (fill), negative means lower (cut).
- Cut slope (H:V) and Fill slope (H:V): positive values (H>0, V>0).
- SPCAD chooses fill slope when Relative ≥ 0, cut slope when Relative < 0.
- The horizontal distance is constant for the whole run: |Relative| / (V/H) for the chosen slope.
Behavior:
- A constant-offset daylight is built in 2D, then filleted at concave corners (radius = that distance).
- Daylight Z is baseZ + Relative everywhere.
- Per-segment triangulation ensures no crossing faces around bends.
4- Output
- Daylight (optional): a 3D polyline on the current layer (or the feature’s layer).
- Triangles: transient-drawn (and/or persisted by your workflow) with metadata:
- Unique TIN Guid, Name, Min/Max extents, counts, etc.
- Color scheme per your Elevation ramp/metadata configuration.
5- Practical Tips
- Choosing Slope Signs
- For Grade to Distance only: use a negative V when you want the grade to go down from the base; H stays positive.
- For Grade to Elevation / Relative: enter positive H:V for both Cut and Fill; the tool picks the correct one automatically based on whether the target/relative is above or below the base.
- Grading Side
- “Left/Right” is relative to the vertex order. If results appear on the wrong side, reverse the polyline or switch the side in the UI.
- Closed vs Open
- Closed features are supported. Stitching and wrap-around are handled so there are no missing triangles at the seam.
- Corners & Fillets
- Fillets apply only at concave corners on the grading side.
- If an offset is too big for a very short span, the fillet radius is reduced automatically to keep tangency and avoid geometry failure.
- Performance
- Very dense polylines or many short bulged segments can be heavy. If preview feels slow, simplify the base or reduce bulge tessellation tolerance before grading.
- QA Checks
- Turn on Draw Day Light Line and compare with the base; there should be no intersections.
- Inspect corners: you should see small arc-like runs at concave bends (not spikes).
6- Troubleshooting
- Daylight intersects the base
- Check grading side vs feature direction.
- For Grade to Distance, verify the V sign (use negative V for downward).
- Ensure Distance is not zero and slopes are reasonable.
- For Grade to Elevation/Relative, make sure H and V are positive, and the expected slope (cut vs fill) is logically selected by the target/relative.
- Missing/odd triangles near corners
- This usually indicates the daylight mapping jumped across more than one base segment. SPCAD’s per-segment triangulation and index monotonicity fix this; if you imported legacy code, keep the “per-segment fan” triangulator enabled.
- No fillet where expected
- The corner may be convex on the chosen side (fillet not needed).
- The effective radius could be effectively zero at that vertex (e.g., ΔZ≈0 or very small distance).
- Jig doesn’t accept input while the dialog is open
- Ensure the command was started from the dialog’s Apply to entire length checkbox handler; SPCAD uses EditorUserInteraction so clicks go to AutoCAD. If you opened the dialog outside a document context, start a new command in an active drawing.
7- Reference: Field Meanings
- Distance – Horizontal offset (drawing units).
- Target elevation – Absolute Z (same units as drawing).
- Relative elevation – ΔZ added to the base (+ up, − down).
- Cut slope (H:V) – Use positive H and positive V. Steeper slope ⇒ bigger V for the same H.
- Fill slope (H:V) – Same entry rules; used automatically when grading “up”.
