XSM LISP: Smooth Cross-Section Ground Line (Free AutoLISP Download)
Cross-section drawings built from straight-line segments connecting each measured value make the natural ground line look artificially angular rather than like a real, continuously undulating surface. Native CAD spline smoothing can deviate too far from the actual surveyed values to be usable. XSM smooths a cross-section ground line while staying much closer to the true data, controlled by a user-specified vertex insertion interval.
XSSMOOTH-bgol (Smooth Cross-Section Ground Line)
Command Type: AutoLISP routine (works in AutoCAD, BricsCAD, ZWCAD and most AutoLISP-compatible CAD platforms)
Developed by: BGol Community, bgol.in
Inspired by the general concept of cross-section smoothing utilities used in survey/civil drafting. This is an original, independently written routine, new file name, new command name, new source code, created so the CAD community has a free, editable, open-source alternative.
Overview
Cross-section drawings built from straight-line segments connecting each measured value make the natural ground line look artificially angular rather than like a real, continuously undulating surface. Native CAD spline smoothing can deviate too far from the actual surveyed values to be usable. XSM smooths a cross-section ground line while staying much closer to the true data, controlled by a user-specified vertex insertion interval.
How to Use
- Load
XSSMOOTH-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
XSMat the command line and press Enter. - Select the ground/natural-surface cross-section line to smooth.
- Enter the vertex insertion interval (how densely new points should be sampled).
- A new, smoothed LWPOLYLINE is created on a dedicated layer,
BGOL-XSM(colour blue), closely tracking the original data. The source line is left completely untouched.
Why Use It
- Produces a much more realistic, natural-looking representation of ground surface in cross-section drawings compared to the raw straight-segment output most software generates.
- Avoids the major shape-deviation problem of native CAD spline smoothing, which can distort surveyed ground data to the point of being misleading.
- User control over the vertex insertion interval allows balancing smoothness against fidelity to the original data.
- Only the selected line is touched, other cross-section elements (design/canal profile, dimension text, etc.) remain sharp and accurate.
Where to Use It
- Improving the visual quality/realism of ground/natural-surface lines in cross-section drawings for canals, roads, drains, or any earthworks project.
- Client-facing or presentation-quality cross-section deliverables where a jagged, obviously-segmented ground line looks unprofessional or hard to interpret.
- Any cross-section drafting task needing a smoother ground representation while preserving reasonable adherence to surveyed values.
Notes
- Smoothing uses a simple 3-point moving average applied to the elevation (Y) component of each sampled point, not a full spline fit, which is what keeps the result close to the original data instead of overshooting like a native spline conversion can.
- The first and last points are left unsmoothed so the new line still starts and ends exactly where the original did.
- Source code is fully open, feel free to study, modify, and redistribute it under the same open, free-for-all spirit.
Credits
Developed and shared for the CAD community by BGol Community. Website: https://bgol.in/ Free and open-source, use it, modify it, share it, for personal or commercial work alike.
Frequently Asked Questions
XSM is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
Smoothing uses a simple 3-point moving average applied to the elevation (Y) component of each sampled point, not a full spline fit, which is what keeps the result close to the original data instead of overshooting like a native spline conversion can.
Produces a much more realistic, natural-looking representation of ground surface in cross-section drawings compared to the raw straight-segment output most software generates.
Yes. XSM is fully open-source and free to use, modify, and redistribute for both personal and commercial work, developed and shared by the BGol Community.
Drag and drop XSSMOOTH-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type XSM at the command line to run it.
๐ค About BGol Community
BGol Community of Advanced Surveying builds and shares free, open-source tools for the survey and CAD drafting community.
๐ Made with โค๏ธ by BGol Community of Advanced Surveying
Free, open-source, and built for the CAD community, for personal or commercial use, always.