Advanced Polyline Outline
|Function Syntax||polyout / mpolyout|
|View HTML Version||AdvancedPolyOutlineV1-1.html|
With the recent development of my 5-Point Ellipse function, I recognised the potential application of the function to approximate the boundary of an LWPolyline arc segment with non-constant width using an appropriate elliptical arc, and so here I present an extension to my original Polyline Outline program.
This program allows the user to construct the outline silhouette of an LWPolyline with straight and/or arc segments with varying or constant width; this more advanced program is hence not limited solely to straight segmented LWPolylines - a restriction imposed by my previous program of the same name.
The program offers two commands: polyout allows the user to outline a single LWPolyline with segments of non-zero width; and mpolyout allows the user to make a selection of multiple such LWPolylines for which to generate the outline silhouette. The user will also be asked whether or not to delete the original LWPolyline(s) for each program.
Both programs call a single function 'LM:AdvPolyOutline' with each LWPolyline entity to be processed, and as such, these 'calling programs' are purely examples and may be customised to suit the needs of the individual.
The LM:AdvPolyOutline function is the core of the program and will generate an outline composed of individual Lines, Circular Arcs, and Elliptical Arcs if necessary for a supplied LWPolyline entity. If a silhouette is successfully generated, the example programs described above will proceed to utilise the AutoCAD PEDIT command to join the resulting components to form continuous LWPolylines where possible - of course, Elliptical Arcs cannot form part of an LWPolyline, so these must remain isolated in the drawing.
The majority of the restrictions imposed on the previous incarnation of this program have now been overcome, however, the program remains limited for use with non-self-intersecting LWPolylines.
The program will produce best results for LWPolyline arc segments whose vertex locations have not been independently modified following creation of the original LWPolyline; i.e. arc segments which remain tangent to surrounding segments. For arc segments which do not meet the neighbouring segments tangentially, there may be some overlap of objects constituting the resulting outline.
LWPolyline arc segments with varying start & end width will be approximated using an Elliptical Arc entity; however, please note that arc segments spanning more than π radians, or with a high width differential will not necessarily define an outlining Elliptical Arc and such segments will hence be ignored.
Instructions for Running
Please refer to How to Run an AutoLISP Program.