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
- fn: A string representing the filename. The filename must be in a specific format to extract the desired information.
Output
- nvf: An array containing the number of vertices and facets extracted from the filename. If the filename does not contain this information, the function returns
false
.
Algorithm Steps
- Check if the input
fn
is empty. If it is, return an empty array and display a warning message.
- Split the filename
fn
using delimiters 'V='
, 'F='
, '-'
, '.'
, and '_'
.
- Convert the split parts into numbers using
str2double
.
- Filter out
NaN
values from the converted numbers.
- Check the number of elements in the filtered array:
- If there are more than one element, assign the first two elements to
nvf
(representing vertices and facets).
- If not, set
nvf
to false
.
- 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