FLremove2Dh
by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 1.0, Creation date: 2012-10-13, Last change: 2025-09-14
removes facets from a solid generated with VLFLclose2Dh
Description
If a solid is generated using VLFLclose2Dh, it is possible to reconstruct the ordner of the facets and to remove facets from the facet list. It is used in FTelement for example. After removing facets once, the order of facets is unknown!
The original order of the facets is: [FWallA;FWallB,FLBottom;FLTop]
See Also:
Example Illustration
Syntax
[FL]=FLremove2Dh(FL,nc,rml)
Input Parameter
FL: | | Original facet list |
nc: | | number of factes of the caps |
rml: | | list of facets to remove |
Output Parameter
Copyright 2012-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 remove specific facets from a solid's facet list, which was originally generated using the VLFLclose2Dh function. The function is part of the SG-Library and is used to manipulate the facet list of a 3D solid.
Input Parameters
- FL: The original facet list, which is a matrix where each row represents a facet.
- nc: The number of facets that make up the caps of the solid.
- rml: A list of indices indicating which facets should be removed from the facet list.
Output
- FL: The new facet list after the specified facets have been removed.
Algorithm Steps
- Calculate the total number of facets,
n, from the size of the input facet list FL.
- Determine the number of wall facets,
nw, by subtracting twice the number of cap facets nc from n.
- Calculate the number of facets per wall,
nv, by dividing nw by 2.
- Split the original facet list
FL into four parts:
FWA: Facets of Wall A, from the start to nv.
FWB: Facets of Wall B, from nv+1 to 2*nv.
FLB: Bottom cap facets, from 2*nv+1 to 2*nv+nc.
FLT: Top cap facets, from 2*nv+nc+1 to 2*nv+2*nc.
- Iterate over each index in the
rml list to remove specified facets:
- If the index matches
nv+1, set FLB to an empty array, effectively removing all bottom cap facets.
- If the index matches
nv+2, set FLT to an empty array, effectively removing all top cap facets.
- If the index is between 1 and
nv, set the corresponding row in FWA and FWB to [0 0 0], marking them for removal.
- Remove duplicate rows from
FWA and FWB using the unique function.
- If the first row of
FWA or FWB is [0 0 0], remove it.
- Concatenate the modified
FWA, FWB, FLB, and FLT to form the new facet list FL.
Algorithm explaination created using ChatGPT on 2025-08-19 01:26. (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