CPLN=CPLbufferEdges(CPL,[r,t])
CPL : | Closed Polygon Line | |
r : | radius; default is 0.3 | |
t : | 'square', 'round' |
CPLN : |
CPLbufferEdges([PLgearDIN(1,9);nan nan;PLcircle(.5)],.3,'round')
CPLbufferEdges([PLgearDIN(1,9);nan nan;PLcircle(.5)],.3,'square')
This function, CPLbufferEdges
, is designed to modify the edges of a closed polygon line (CPL) by either rounding or squaring them. It is part of the SolidGeometry library and was introduced in version 4.3.
r
and type t
from the input parameters using getfuncparams
. If not provided, default values are used (0.3 for r
and 'round' for t
).CPLbuffer
with the original CPL, a negative radius -r
, and 'miter' to create an initial buffered polygon cpl
.CPLbuffer
again on the buffered polygon cpl
with the radius r
and the specified type t
('square' or 'round') to obtain the final modified polygon CPLN
.nargout==0
), plot the original and modified polygons using SGfigure
, CPLplot
, and CVLplot
for visualization.The function warns that using 'round' may create too many points, which can be problematic for 3D printing. 'Square' doubles the number of points, while 'round' at least triples them.
Algorithm explaination created using ChatGPT on 2025-08-19 00:59. (Please note: No guarantee for the correctness of this explanation)