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
- CPL: The original closed polygon list, represented as a matrix with two columns for x and y coordinates.
- dx: The buffer distance applied to the regions. If not provided, it defaults to 0.1.
Output Results
- cc: A cell list of overlapping polyshapes.
- vv: A list of comparisons, represented as pairs [i, k].
- reg: A cell list of regions.
Algorithm Steps
- Retrieve the buffer distance
dx
from the input parameters or set it to 0.1 if not provided.
- Create a polyshape object
ps
from the CPL coordinates.
- Determine the number of regions
nr
in the polyshape.
- Generate a permutation vector
vv
for all region pairs, ensuring the second index is greater than the first.
- Initialize cell arrays
cc
and regbuff
to store results.
- For each region, create a buffered version using
polybuffer
and store it in regbuff
.
- For each pair of regions in
vv
, compute their intersection and store it in cc
. If no intersection exists, store an empty array.
- If only one element in
cc
is empty, increase dx
by 20% and recursively call the function.
- 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