SGTcheckSTLwrite

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Problems Find/Check/Fix
Introduced first in SolidGeometry 5.0, Creation date: 2020-12-02, Last change: 2025-09-15

A simple test fnct to double check the writing of frames into STL files



See Also: SGT2SGN , SGN2SGT , SGwriteSTL , SGreadSTL

Example Illustration

 missing image of SGTcheckSTLwrite (A)

Syntax

SGTcheckSTLwrite([A])

Input Parameter

A: Solid to be checked

Examples


load JACO_robot.mat; A=JCF;
SGTcheckSTLwrite(A)




Copyright 2020-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, SGTcheckSTLwrite, is designed to test the process of writing and reading STL files using a solid geometry object. It is part of the SolidGeometry library and was introduced in version 5.0.

Input Parameters

Algorithm Steps

  1. Parameter Retrieval: The function retrieves the input parameter A using getfuncparams. If A is empty, it loads a default solid geometry object from JACO_robot.mat.
  2. Plot Original Solid: The original solid with frames is plotted using SGTplotalpha with a white color and 0.5 transparency. The view is set to angles -30 and 30 degrees.
  3. Convert and Reconstruct:
    • B = SGT2SGN(A): Converts the solid geometry with frames into normal vectors.
    • A1 = SGN2SGT(B): Reconstructs the original solid from the normal vectors.
    The reconstructed solid is plotted in red with 0.5 transparency.
  4. Write to STL: The original and converted solids are written to STL files using SGwriteSTL. The filenames are Frametest-A and Frametest-B.
  5. Read from STL: The STL files are read back into solid geometry objects CA and CB using SGreadSTL.
  6. Plot Reconstructed Solids:
    • CA: Plotted in green, representing the solid imported and reconstructed from automatic normals.
    • CB: Plotted in magenta, representing the solid reconstructed from explicit normals.
Algorithm explaination created using ChatGPT on 2025-08-19 07:36. (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