CPLremoveoverlap

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 4.7, Creation date: 2019-07-04, Last change: 2025-09-14

For each contour of CPL the polyshape is simplified

Description

Some functions such as SGofCPLZ require CPL contours that have no selfcrossing/overlap
CPLrepair,
CPLremoveoverlap,
CPLregionsholes,
CPLrecontour
CPLremnoise
CPLfft
CPLoutercontour

See Also: CPLrepair , CPLregionsholes , CPLrecontour , CPLremnoise , CPLfft , CPLoutercontour

Example Illustration

 missing image of CPLremoveoverlap(CPL)

Syntax

CPL=CPLremoveoverlap(CPL)

Input Parameter

CPL: Original CPL

Output Parameter

CPL: CPL without overlapping areas

Examples


CPLremoveoverlap([CPLsample(25)]);
CPLoutercontour(CPLsample(25))




Copyright 2019-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 algorithm is designed to remove overlapping areas from a Closed Polygon List (CPL). It simplifies each contour of the CPL using MATLAB's polyshape functionality.

Input Parameters

Output Results

Algorithm Steps

  1. Determine the number of separate contours in the CPL using the separateNaN function, which identifies contours separated by NaN values.
  2. Store the original CPL in CPLorg for comparison or plotting purposes.
  3. Suppress warnings related to polyshape simplification using warning('off','MATLAB:polyshape:repairedBySimplify').
  4. Iterate over each contour in the CPL:
  5. Restore the original warning state using warning(wstat).
  6. If no output argument is specified, plot the original and modified CPLs for visual comparison:
Algorithm explaination created using ChatGPT on 2025-08-19 01:27. (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