iscrossingCPL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Geometric Queries
Introduced first in SolidGeometry 2.7, Creation date: 2015-09-27, Last change: 2025-09-14

checks crossing/touching of two CPLs

Description

Not optimized function for use/help during development.
See also: https://de.wikipedia.org/wiki/Polygon


See Also: PLcross2Lines , PLcrossCPLline

Example Illustration

 missing image of iscrossingCPL(CPLA,CPLB,touch)

Syntax

[c,pc]=iscrossingCPL(CPLA,[CPLB,touch])

Input Parameter

CPLA: Closed polygon A
CPLB: Closed polygon B
touch: check touch instead of cross; default is true

Output Parameter

c: true/false
pc: first detected crossing point

Examples


PL=VLui; iscrossingCPL(PL(:,1:2),[],false)




Copyright 2015-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, iscrossingCPL, checks if two closed polygon lists (CPLs) intersect or touch each other. It is part of the SolidGeometry library and was developed by Tim Lueth.

Input Parameters

Output Results

Algorithm Steps

  1. Check if CPLB is provided; if not, set it to CPLA.
  2. Set touch to true unless specified otherwise.
  3. Convert CPLA and CPLB to closed polygon lists using CPLofPL.
  4. Determine the number of points in CPLB.
  5. Iterate over each segment of CPLB:
  6. If no output arguments are specified, plot the polygons and any intersection points using SGfigure, CPLplot, and PLplot.
Algorithm explaination created using ChatGPT on 2025-08-19 01:41. (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