CPLregionbufferintersect

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CPL/Closed Polygon Lists
Introduced first in SolidGeometry 5.2, Creation date: 2022-02-24, Last change: 2025-09-15

detects the overlapping area of increased regions



See Also: CPLbuffer , CPLregionshrink

Example Illustration

 missing image of CPLregionbufferintersect(CPL,dx)

Syntax

[cc,vv,reg]=CPLregionbufferintersect(CPL,[dx])

Input Parameter

CPL: Original CPL
dx: buffered

Output Parameter

cc: cell list if overlapping polyshapes
vv: list of comparision [i k]
reg: cell list of regions

Examples


CPLregionbufferintersect(CPLsample(41),1)
[x,vv]=CPLregionbufferintersect(CPLsample(41),1)




Copyright 2022-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, CPLregionbufferintersect, detects overlapping areas of increased regions in a closed polygon list (CPL). It is part of the SolidGeometry library.

Input Parameters

Output Results

Algorithm Steps

  1. Retrieve the buffer distance dx from the input parameters or set it to 0.1 if not provided.
  2. Create a polyshape object ps from the CPL coordinates.
  3. Determine the number of regions nr in the polyshape.
  4. Generate a permutation vector vv for all region pairs, ensuring the second index is greater than the first.
  5. Initialize cell arrays cc and regbuff to store results.
  6. For each region, create a buffered version using polybuffer and store it in regbuff.
  7. For each pair of regions in vv, compute their intersection and store it in cc. If no intersection exists, store an empty array.
  8. If only one element in cc is empty, increase dx by 20% and recursively call the function.
  9. If no output arguments are specified, plot the original CPL, buffered regions, and intersections using different colors.
Algorithm explaination created using ChatGPT on 2025-08-19 07:28. (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