PLELpushin
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - PLEL/Point List/Edge List
Introduced first in SolidGeometry 1.1, Creation date: 2013-12-28, Last change: 2025-09-14
pushes points of contour B into contour A
Description
For Boolean operations of plane surfaces, it is important to make sure that NO point of a contour B is on a point or edge of contour A. Otherwise the result of a Delaunay-Triangulation is unpredictable incorrect. To solve this problem, we move all points of B that are on the contour of A inside(!) contour A. Therefor, it is necessary that the edge list of A is complete and sorted using the right hand rule.
Please use ELreconnect and ELflip to make sure that all contours of A are definitely in correct order
WORK under progress. SLOW AND DIRTY AT THE MOMENT
Example Illustration
Syntax
PLB=PLELpushin(PLA,ELA,PLB,[thr])
Input Parameter
PLA: | | Point list A |
ELA: | | Edge list of A (right hand order) |
PLB: | | Point list B to test and shift |
thr: | | shift value; default = 1e-12 |
Output Parameter
Copyright 2013-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 adjust the points of contour B so that they do not lie on the points or edges of contour A. This is crucial for Boolean operations on plane surfaces to ensure accurate Delaunay Triangulation results.
Input Parameters
- PLA: Point list A, representing the vertices of contour A.
- ELA: Edge list of A, which should be sorted using the right-hand rule.
- PLB: Point list B, containing the points to be tested and potentially shifted.
- thr: Optional shift value, defaulting to 1e-12 if not provided.
Output
- PLB: The adjusted point list B, with points shifted if necessary.
Algorithm Steps
- Initialize the threshold
thr to 1e-12, unless a different value is provided.
- Iterate over each point
pc in PLB.
- For each point
pc, iterate over each edge in ELA.
- For each edge, calculate the points
pa and pb from PLA using the indices from ELA.
- Compute the parameter
k to determine if pc lies on the line segment between pa and pb.
- Check if
k indicates that pc is on the edge, considering the threshold thr.
- If
pc is on the edge, calculate a perpendicular direction pd to the edge and shift pc by -pd.
- Continue until all points in
PLB are processed.
Algorithm explaination created using ChatGPT on 2025-08-19 08:13. (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