SGfacenum

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

returns the number of facets of a solid geoemtry

Description

It makes sense to reduce the number of facets after an boolean melting operation to the number of facets the object had before

See Also: SGreduceVLFL , nofVLFL

Example Illustration

 missing image of SGfacenum(SG)

Syntax

nF=SGfacenum(SG)

Input Parameter

SG: Solid Geometry, can be nested

Output Parameter

nF: number of facets

Examples


SGfacenum(SGsample(25))




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, SGfacenum, is designed to return the number of facets in a given solid geometry (SG). It is part of the SG-Library and was introduced in SolidGeometry version 4.1.

Input Parameters

Output Results

Algorithm Explanation

The function SGfacenum operates as follows:

  1. It calls another function, VLFLofSG, passing the solid geometry SG as an argument. This function is assumed to return two outputs, but only the second output, FL, is used in this context.
  2. FL is expected to be a list or array where each row represents a facet of the solid geometry.
  3. The function then calculates the number of facets by determining the number of rows in FL using the size function. Specifically, size(FL,1) returns the number of rows, which corresponds to the number of facets.
  4. The result, nF, is the number of facets and is returned as the output of the function.

Example Usage

An example of how to use this function is provided:

SGfacenum(SGsample(25))

In this example, SGsample(25) presumably generates a sample solid geometry with a specific configuration, and SGfacenum is used to determine the number of facets in that geometry.

Algorithm explaination created using ChatGPT on 2025-08-18 22:27. (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