STLAsctoBin

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Import/Export
Introduced first in SolidGeometry 1.0, Creation date: 2012-04-13, Last change: 2025-09-14

reads and STL-File in ASCII format and writes it in binary format

Description

The new filename is the old one plus the character 'b'.

See Also: SGreadSTL , SGwriteSTL , VLFLreadSTL , VLFLwriteSTL

Example Illustration

 missing image of STLAsctoBin (fname)

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

Algorithm Steps

  1. 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.
  2. 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.
  3. 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