Syntax
STLAsctoBin(fname)
Input Parameter
fname : | | Filename on desktop |
Examples
Convert ASCII file 'TEST-5.STL' to binary file TEST-5b.STL'
STLAsctoBin ('TEST-5')
Copyright 2012-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, STLAsctoBin
, is designed to convert an STL file from ASCII format to binary format. It is part of the SolidGeometry library and was created by Tim Lueth. The function takes a single input parameter:
Input Parameter
- fname: The filename of the STL file in ASCII format, located on the desktop. The function expects the file to be named without the extension, e.g., 'TEST-5' for 'TEST-5.STL'.
Algorithm Steps
- The function begins by reading the ASCII STL file using the
VLFLreadSTL
function. This function returns two outputs:
- VL: A list of vertices from the STL file.
- FL: A list of facets (triangles) from the STL file.
- Next, the function writes the data to a new binary STL file using the
VLFLwriteSTLb
function. The new filename is the original filename with an added 'b' character, e.g., 'TEST-5b.STL'. The function also includes a comment 'processed by Tim Lueth' in the binary file.
- Finally, the function calls
VLFLchecker
to perform a check on the vertices and facets. This step ensures the integrity and correctness of the data.
Additional Information
The function is part of a library for handling STL files and is related to other functions such as SGreadSTL
, SGwriteSTL
, VLFLreadSTL
, and VLFLwriteSTL
. These functions are used for reading and writing STL files in different formats.
Algorithm explaination created using ChatGPT on 2025-08-18 22:52. (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