by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 4.3, Creation date: 2018-10-30, Last change: 2025-09-14
See Also: CPLbuffer
, CPLofPLgrowline
CPL=CPLofPLgrow(PL,R)
PL: | point list [n x 2] | |
R: | Radius |
CPL: |
CPLofPLgrow(PLstar(10),1)
CPLofPLgrow(PLstar(10),2)
CPLofPLgrow([PLstar(10);nan nan;PLstar(5)],1)
This function, CPLofPLgrow, is designed to create closed polygon lists (CPL) by generating circles around each point in a given point list (PL) with a specified radius (R).
n x 2 matrix, where each row corresponds to a point in 2D space.PL is empty. If it is, return an empty list CPL and exit the function.polybuffer function to create a buffer around the points in PL. The buffer is created with the specified radius R and the type 'points', which indicates that circles are to be created around each point.ps and assign them to CPL.nargout==0), plot the results:
SGfigure to create a new figure window.CPL using CPLplot with a green line style ('g-').PL using PLplot with red dots ('r.').CPLofPLgrow(PLstar(10),1): Creates a CPL with circles of radius 1 around points generated by PLstar(10).CPLofPLgrow(PLstar(10),2): Similar to the above, but with a radius of 2.CPLofPLgrow([PLstar(10);nan nan;PLstar(5)],1): Creates a CPL with circles of radius 1 around points from two separate point lists, PLstar(10) and PLstar(5), separated by nan values.