SP2P LISP: Convert Smooth Polyline to Regular Polyline (Free AutoLISP Download)
SP2P converts a smoothed (PEDIT โ Spline) polyline back into a regular polyline built from many closely-spaced straight segments that trace the smooth curve's true shape. AutoCAD's spline-fit smoothing is purely cosmetic, many LISP tools still only see the original coarse vertices. This routine bridges that gap.
SPL2SEG-bgol (Convert Smooth Polyline to Regular Polyline)
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 spline-to-polyline resampling utilities used in CAD/survey 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
SP2P converts a smoothed (PEDIT โ Spline) polyline back into a regular polyline built from many closely-spaced straight segments that trace the smooth curve's true shape. AutoCAD's spline-fit smoothing is purely cosmetic, many LISP tools still only see the original coarse vertices. This routine bridges that gap.
How to Use
- Load
SPL2SEG-bgol.lspinto your CAD session (drag-and-drop the file onto the drawing window, or use theAPPLOADcommand). - Type
SP2Pat the command line and press Enter. - Select the smoothed (splined) LWPOLYLINE.
- A new, densely-segmented regular polyline that closely traces the original smooth curve is created on a dedicated layer,
BGOL-SP2P(colour cyan). The original smooth polyline is left untouched.
Why Use It
- Bridges cosmetic vs. real geometry, spline-fit smoothing is visual only; this produces a polyline other LISP routines can process correctly.
- Keeps the smooth look, the dense segment spacing still appears visually smooth at normal zoom levels.
- Prep step, useful before running any other vertex-dependent routine (coordinate export, vertex marking, interpolation) on a polyline that was originally smoothed for presentation.
Where to Use It
- Converting aesthetically smoothed survey or design lines back into a computationally usable, densely-segmented polyline.
- Preparing curve-heavy drawings for export or analysis tools that require actual polyline vertex data rather than a spline definition.
- Any workflow where a polyline was smoothed for visual presentation but now needs vertex-based processing.
Notes
- Sampling density defaults to 60 points along the curve; edit the
*bgol-sp2p-samples*constant near the top of the .lsp file for a finer or coarser result. - Works on LWPOLYLINE entities; both open and closed smoothed polylines are supported.
- The original smoothed polyline is not deleted, so you can compare or remove it manually once you have confirmed the conversion.
- 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
SP2P is a standard AutoLISP routine, so it runs in AutoCAD, BricsCAD, ZWCAD, and most other AutoLISP-compatible CAD platforms without modification.
Sampling density defaults to 60 points along the curve; edit the *bgol-sp2p-samples* constant near the top of the .lsp file for a finer or coarser result.
Bridges cosmetic vs. real geometry, spline-fit smoothing is visual only; this produces a polyline other LISP routines can process correctly.
Yes. SP2P 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 SPL2SEG-bgol.lsp onto your open drawing window, or load it through the APPLOAD command, then type SP2P 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.