nofVLFL

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Geometric Queries
Introduced first in SolidGeometry 4.1, Creation date: 2017-08-08, Last change: 2025-09-14

returns the number of facets with an area larger than 0.1 mm^2 and the facet list

Description

This function is useful in combination with reducepatch/SGreduceVLFL after an SG boolean operation. In such a case a lot of additional triangles are added that could be removed by retesselation/



See Also: VLFLarea , SGreduceVLFL , SGfacenum

Example Illustration

 missing image of nofVLFL(VL,FL,amin);

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

Output Results

Algorithm Steps

  1. 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.
  2. 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.
  3. Calculate the area of each facet using the VLFLarea function. This function returns the areas of all facets.
  4. Create a logical array Ai where each element is true if the corresponding facet's area is greater than or equal to amin.
  5. 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