CPLfeatureedge

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 5.1, Creation date: 2021-11-25, Last change: 2025-09-15

selects corners with an angle larger a limit



See Also: PLangle , PLELofFeatureEdges

Example Illustration

 missing image of CPLfeatureedge(CPL,al)

Syntax

[FE,FEi]=CPLfeatureedge(CPL,[al])

Input Parameter

CPL: Closed Polygon list
al: alpha; default is pi/4 (45 degree)

Output Parameter

FE: List of Points
FEi: Index of FE within CPL

Examples


CPLfeatureedge(CPLsample(1)) % random shape
CPLfeatureedge(PLcircle(1)) % 16 edges, limit is 16
CPLfeatureedge(PLcircle(2)) % 32 edges but limit to small




Copyright 2021-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 identifies feature edges in a closed polygon list (CPL) by selecting corners with an angle larger than a specified limit.

Input Parameters

Output Results

Algorithm Steps

  1. Set the angle threshold al using getfuncparams, defaulting to pi/8 if not provided.
  2. Determine the number of separate polygons in CPL using separateNaN.
  3. Initialize an empty array FE to store feature edge points.
  4. Initialize a counter k to track the number of feature edges found.
  5. Iterate over each separate polygon in CPL:
  6. Trim FE to include only the found feature edges.
  7. If the function is called with two output arguments, find the indices of feature edges in CPL using findVL.
  8. If no output arguments are specified, plot the original polygon and the feature edges using SGfigure, CPSplot, and PLplot.
Algorithm explaination created using ChatGPT on 2025-08-19 00:56. (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