PLconnectopenradial

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

closes an open line by a contour

Description

Uses:
VLradialEdges



See Also: PLtangentarc4P

Example Illustration

 missing image of PLconnectopenradial(PL,R);

Syntax

PLconnectopenradial(PL,[R]);

Input Parameter

PL: single open line
R:

Examples


PLconnectopenradial(rand(10,2)*100);
PLconnectopenradial(rand(10,2)*100); CPL=ans; SGfigure; CPLplot(CPL,'m-');




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 function, PLconnectopenradial, is designed to close an open line by creating a contour. It is part of the SolidGeometry library and was introduced in version 4.5. The function takes an open line, represented by a set of points, and optionally a parameter R, which defaults to 100 if not provided.

Input Parameters

Algorithm Steps

  1. Extract the first two points and the last two points of the line PL to form PLA and PLB respectively.
  2. Calculate the unit direction vectors ea and eb for PLA and PLB.
  3. Compute orthogonal vectors oa and ob to ea and eb.
  4. Determine the distances d1 and d2 using the function cross2edges2, which finds intersections of lines.
  5. Calculate the minimum distance d from d1 and d2.
  6. Compute the angle w1 between ea and eb using acos2.
  7. Create a new set of points PLX that extends PL by adding points based on the calculated distances and directions.
  8. Call VLradialEdges with PLX and R to generate a closed polygon PLN.
  9. Trim PLN to remove the first two and last two points, then append it to PL to form PLA.
  10. If no output is requested, plot the original line PL and the new closed line PLN.
Algorithm explaination created using ChatGPT on 2025-08-19 07:56. (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