PLroutefind

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - PL/Point Lists
Introduced first in SolidGeometry 3.3, Creation date: 2017-01-04, Last change: 2025-09-14

returns a right angle point list between start and end point



See Also: smbNewLineRouting

Example Illustration

 missing image of PLroutefind(PL)

Syntax

NPL=PLroutefind(PL)

Input Parameter

PL: Original Point List

Output Parameter

NPL: New Point List




Copyright 2017-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 algorithm is designed to find a right-angle point list between a start and end point from an original point list (PL). It is part of the SG-Library and was created by Tim Lueth in 2017.

Input Parameters

Output Results

Algorithm Steps

  1. Extract the first point p1 and the last point p2 from the point list PL.
  2. Initialize a variable gr with a value of 5, which is used to adjust the points.
  3. Check if the x-coordinate of p2 is less than that of p1. If true, swap p1 and p2 and set a switch flag sw to true; otherwise, set sw to false.
  4. Calculate the direction vectors e1 and e2 using the helper function domez for the first and last segments of the point list, respectively.
  5. Adjust p1 and p2 by adding gr times the direction vectors e1 and e2.
  6. Create a new point matrix pm that includes p1, a right-angle turn point, and p2.
  7. Construct the new point list NPL by combining the first point of PL, the points in pm, and the last point of PL.
  8. Remove any straight-line segments from NPL using the function VLremstraightCVL.
  9. If the switch flag sw is true, reverse the order of NPL.
  10. If no output is requested, plot the original and new point lists using SGfigure and PLplot.

Helper Function: domez

The domez function calculates a unit direction vector along the axis of the largest component of a given vector A. It finds the index of the maximum absolute value in A, sets that component to 1 (or -1 depending on the sign), and zeros out the other components.

Algorithm explaination created using ChatGPT on 2025-08-18 23:02. (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