SGarchivefilename

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

returns a filename for fast access to similar geometries

Description

SGwriteSTLarchive, SGarchivefilename, SGsizeofFilename, SGisidentical

See Also: SGwriteSTLarchive , SGsizeofFilename , SGisidentical

Example Illustration

 missing image of SGarchivefilename(SG)

Syntax

[fn,fndim,fngeo]=SGarchivefilename(SG)

Input Parameter

SG: Solid Geometry

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

Output Results

Algorithm Steps

  1. The function begins by ensuring the input SG is in the correct format using SGofSG(SG).
  2. It calculates the bounding box dimensions using sofBB(SG) and rounds them to the nearest 0.1 mm using rounddiv(ss, .1).
  3. 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.
  4. The fndim string is constructed to include the volume and dimensions in the format 'VOL=%.1f[%.1fx%.1fx%.1f]'.
  5. The fngeo string is constructed to include the number of vertices and faces in the format 'V=%dF=%d'.
  6. 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