Syntax
[fn,fndim,fngeo]=SGarchivefilename(SG)
Input Parameter
Output Parameter
fn : | | filename without STL |
fndim : | | part for dimension comparison (Volumen and X*Y*Z) |
fngeo : | | part for geometry comparision (VL/FL) |
Examples
SGarchivefilename(SGservosample(3))
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, SGarchivefilename
, is designed to generate a filename for fast access to similar geometries. It is part of the SolidGeometry library and was introduced in version 4.8. The function takes a single input parameter and returns three output results.
Input Parameter
- SG: This is the Solid Geometry input, which represents the geometric data structure that the function will process.
Output Results
- fn: This is the generated filename without the STL extension. It combines information about the volume and geometry of the input.
- fndim: This part of the filename is used for dimension comparison. It includes the volume and the dimensions (X, Y, Z) of the bounding box.
- fngeo: This part of the filename is used for geometry comparison. It includes the number of vertices (V) and faces (F) in the geometry.
Algorithm Steps
- The function begins by ensuring the input
SG
is in the correct format using SGofSG(SG)
.
- It calculates the bounding box dimensions using
sofBB(SG)
and rounds them to the nearest 0.1 mm using rounddiv(ss, .1)
.
- The dimensions are sorted in descending order, and the volume is calculated as the product of these dimensions, rounded to the nearest 0.1 mm3.
- The
fndim
string is constructed to include the volume and dimensions in the format 'VOL=%.1f[%.1fx%.1fx%.1f]'
.
- The
fngeo
string is constructed to include the number of vertices and faces in the format 'V=%dF=%d'
.
- The final filename
fn
is a concatenation of fndim
and fngeo
.
Algorithm explaination created using ChatGPT on 2025-08-19 00:26. (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