PLreassign
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - PL/Point Lists
Introduced first in SolidGeometry 1.1, Creation date: 2014-01-11, Last change: 2025-09-14
reassigns the coordinates of a new list to the indices of an original list
Description
Using vertex/point list in combination with edge list or facet list is very common. Sometimes an algorithm reduces the number of points by (VLELselect, VLFLselect, PLELselect, PLFLselect) and afterwards a boolean operator resorts the points list of a facet list or edge list EL. Then, it is finally required to reassign the received vertex list to the original vertex list and to correct the indices in the FL/EL.
Example Illustration
Syntax
b=PLreassign(PLorg,PLnew,[thr])
Input Parameter
PLorg: | | Original point list |
PLnew: | | Final point list |
thr: | | default is 1e-12; |
Output Parameter
b: | | index list to convert a new index list into original indices |
Examples
reassign vertices in a facet list
b=PLreassign(orgPL,newPL)
orgFL=b(newFL)
Copyright 2014-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, PLreassign, is designed to reassign the coordinates of a new list to the indices of an original list. It is particularly useful when working with vertex/point lists in combination with edge or facet lists, where the number of points may be reduced by certain selection algorithms, and a boolean operator resorts the points list of a facet or edge list.
Input Parameters
- PLorg: The original point list. This is the list of points that you want to map the new list onto.
- PLnew: The final point list. This is the list of points that have been modified or reduced and need to be reassigned to the original list.
- thr: An optional threshold value, with a default of
1e-12. This threshold is used for rounding purposes to ensure numerical stability and precision when comparing points.
Output
- b: An index list that converts a new index list into original indices. This list is used to map the indices of the new point list back to the original point list.
Algorithm Steps
- Set the default threshold
thr to 1e-12. If a third argument is provided, update thr with this value.
- Round the original point list
PLorg using the rounddiv function with the threshold thr.
- Round the new point list
PLnew using the rounddiv function with a fixed threshold of 1e-12.
- Use the
ismember function to find the indices of PLnew in PLorg. This function checks for membership of rows of PLnew in PLorg and returns two outputs: a logical array a and an index array b.
Example Usage
To reassign vertices in a facet list, you can use the function as follows:
b = PLreassign(orgPL, newPL);
orgFL = b(newFL);
In this example, orgPL is the original point list, newPL is the new point list, and newFL is the new facet list. The output b is used to map newFL back to the original facet list indices.
Algorithm explaination created using ChatGPT on 2025-08-19 00:53. (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