SGmeshlab

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

opens a solid geoemtry in an STL viewer

Description

This function is used to compare checking results of the SG toolbox with the results of the meshalb STL viewer
SG-Lib 4.7: The Facet colors for Red and Blue are switched because of a Meshlab Bug wrt. to the Materialize Standard

See Also: , VLFLchecknonmanifoldedges , VLFLchecknonmanifoldvertices , SGchecknonmanifoldedges , SGchecknonmanifoldvertices

Example Illustration

 missing image of SGmeshlab (SG,colored,RBchange)

Syntax

SGmeshlab(SG,[colored,RBchange])

Input Parameter

SG: Solid Geometry
colored: if false there are no colors; default is true;
RBchange: if true; A.FC=A.FC(:,[3 2 1]); default is false

Examples


SG=SGsample(35); SGmeshlab(SG); VLFLchecknonmanifoldedges(SG.VL,SG.FL);




Copyright 2018-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, SGmeshlab, is designed to open a solid geometry in an STL viewer, specifically for comparing the results of the SG toolbox with those of the Meshlab STL viewer. The function is part of the SG-Library and was created by Tim Lueth.

Input Parameters

Algorithm Steps

  1. Retrieve the optional parameters using the function getfuncparams. The default for colored is true, and for RBchange is false.
  2. Set the filename fname to 'sglib2meshlab'.
  3. Extract the vertex list (VL), face list (FL), and face colors (FC) from the solid geometry SG using the function VLFLofSG.
  4. If RBchange is true, switch the red and blue components in the face colors (A.FC) to address the Meshlab bug.
  5. If colored is false, remove the face colors field (FC) from the structure A using rmfield.
  6. Write the vertex and face data to an STL file using the function SGwriteSTL, with the filename 'sglib2meshlab'.
  7. Open the resulting STL file using the function openbydoubleclick.
Algorithm explaination created using ChatGPT on 2025-08-19 07:48. (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