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
See Also: smbNewLineRouting
NPL=PLroutefind(PL)
PL: | Original Point List |
NPL: | New Point List |
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.
p1 and the last point p2 from the point list PL.gr with a value of 5, which is used to adjust the points.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.e1 and e2 using the helper function domez for the first and last segments of the point list, respectively.p1 and p2 by adding gr times the direction vectors e1 and e2.pm that includes p1, a right-angle turn point, and p2.NPL by combining the first point of PL, the points in pm, and the last point of PL.NPL using the function VLremstraightCVL.sw is true, reverse the order of NPL.SGfigure and PLplot.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.