SGsizeofFilename

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Auxiliary function
Introduced first in SolidGeometry 4.8, Creation date: 2019-10-24, Last change: 2025-09-14

returns the number of vertices and facets from a SGarchivefilename

Description

Filenames mut fullfil the format:

'VOL=49540.5[54.5x45.0x20.2]V=1978F=4000'

See Also: SGarchivefilename , SGwriteSTLarchive , SGdimofFilename

Example Illustration

 missing image of SGsizeofFilename(fn)

Syntax

nvf=SGsizeofFilename(fn)

Input Parameter

fn: filename in directory found by search

Output Parameter

nvf: returns the V+ and F= values if the filename is containing this information

Examples


fn=SGarchivefilename(SGservosample(3))
SGsizeofFilename(fn),




Copyright 2019-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, SGsizeofFilename, is designed to extract the number of vertices and facets from a filename that follows a specific format. The function is part of the SolidGeometry library and was introduced in version 4.8.

Input Parameters

Output

Algorithm Steps

  1. Check if the input fn is empty. If it is, return an empty array and display a warning message.
  2. Split the filename fn using delimiters 'V=', 'F=', '-', '.', and '_'.
  3. Convert the split parts into numbers using str2double.
  4. Filter out NaN values from the converted numbers.
  5. Check the number of elements in the filtered array:
  6. Additionally, split the filename using delimiters 'VOL=', '[', 'x', and ']' to extract volume-related information, although this is not used in the final output.
Algorithm explaination created using ChatGPT on 2025-08-19 00:21. (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