CPLcrossline

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

calculates the intersection of a CPL with a line



See Also: crossC2P , CPLofPLcrossCPL

Example Illustration

 missing image of CPLcrossline(CPL,PL,acc);

Syntax

CPLX=CPLcrossline(CPL,PL,[acc]);

Input Parameter

CPL: CLosed polygon region
PL: Point list
acc: accuracy, line thickness; default is 0.01

Output Parameter

CPLX: Crossing Area

Examples


CPLcrossline(CPLsample(37),[0 0;0 10],1)




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, CPLcrossline, calculates the intersection of a closed polygon list (CPL) with a line defined by a point list (PL). It is part of the SolidGeometry library.

Input Parameters

Output

Algorithm Steps

  1. The function begins by determining the accuracy parameter, acc, using the getfuncparams function. If acc is not provided, it defaults to 0.1.
  2. The point list PL is converted to its real component using real(PL), ensuring it is in a suitable format for further processing.
  3. The function PLgrowline is called with PL and acc to create a grown line, CPLB, which represents the line with a specified thickness.
  4. The intersection of the closed polygon CPL and the grown line CPLB is calculated using the function CPLintersect, resulting in CPLX.
  5. If no output arguments are specified (nargout==0), the function proceeds to visualize the results:
Algorithm explaination created using ChatGPT on 2025-08-18 23:31. (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