Syntax
[nf,Ai]=nofVLFL(VL,FL,[amin]);
Input Parameter
VL : | | Vertex list |
FL : | | Facet list |
amin : | | threshold; default is 0.1 mm^2 |
Output Parameter
nf : | | number of facets >= amin |
Ai : | | Index list of facets > |
Examples
nofVLFL(SGsample(17))
nofVLFL(SGsample(26))
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 function, nofVLFL
, is designed to calculate the number of facets in a 3D model that have an area larger than a specified threshold. It is particularly useful after performing boolean operations on 3D models, which can introduce many small triangles that may be unnecessary.
Input Parameters
- VL: Vertex List - A matrix where each row represents the coordinates of a vertex in 3D space.
- FL: Facet List - A matrix where each row contains indices into the vertex list, defining a triangular facet.
- amin (optional): A threshold value for the minimum area of interest for a facet. The default value is 0.1 mm².
Output Results
- nf: The number of facets with an area greater than or equal to
amin
.
- Ai: A logical index list indicating which facets meet the area criterion.
Algorithm Steps
- Set the default value for
amin
to 0.1 mm². If a third argument is provided and is not empty, update amin
with this value.
- Check if the input
VL
is a Solid Geometry (SG) object using the isSG
function. If it is, convert it to vertex and facet lists using VLFLofSG
.
- Calculate the area of each facet using the
VLFLarea
function. This function returns the areas of all facets.
- Create a logical array
Ai
where each element is true
if the corresponding facet's area is greater than or equal to amin
.
- Sum the logical array
Ai
to get nf
, the total number of facets meeting the area criterion.
Example Usage
To use this function, you can call it with a sample 3D model:
nofVLFL(SGsample(17))
nofVLFL(SGsample(26))
Algorithm explaination created using ChatGPT on 2025-08-19 00:31. (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