CPLplotbufferlines

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 4.8, Creation date: 2020-01-03, Last change: 2025-09-14

plot buffer lines for a contour



See Also: CPLbufferlines , CPLfindsmalldist

Example Illustration

 missing image of CPLplotbufferlines(CPL,w)

Syntax

h=CPLplotbufferlines([CPL,w])

Input Parameter

CPL: CLosed Polygon Line
w: distance between the buffer lines, default is maximal 15 lines

Output Parameter

h: handle to graphics

Examples


SGfigure; CPLplotbufferlines(CPLsample(29));
SGfigure; CPLplotbufferlines(CPLsample(25),.1);




Copyright 2020-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, CPLplotbufferlines, is designed to plot buffer lines for a closed polygon contour. It is part of the SolidGeometry library and was introduced in version 4.8. The function takes in parameters related to closed polygon lines and the distance between buffer lines, and outputs a handle to the graphics.

Input Parameters

Output

Algorithm Steps

  1. The function begins by retrieving the CPL parameter using getfuncparams. If not provided, it defaults to CPLsample(29).
  2. It calculates bounding box parameters using sofBB and BBofCPL functions.
  3. The distance w is determined using getfuncparams. If not specified, it defaults to min(ss(ss>0))/30.
  4. An iterative process begins with the initial CPLi set to CPL.
  5. In each iteration, CPLbuffer is called to create a buffer line at a distance -w from the current polygon.
  6. If the resulting CPLi is not empty, it increments the counter s and plots the buffer line using CPLplot with a color determined by colofn.
  7. The process repeats until CPLi becomes empty, indicating no further buffer lines can be created.
  8. The function returns the handle h to the plotted graphics.
Algorithm explaination created using ChatGPT on 2025-08-19 00:33. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21