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
- SG: This is the Solid Geometry input, which is the main data structure containing the geometry to be visualized.
- colored: This is an optional parameter. If set to false, the geometry will be displayed without colors. The default value is true, meaning colors are used.
- RBchange: This is another optional parameter. If set to true, it switches the red and blue colors in the facet colors (A.FC) due to a known bug in Meshlab. The default value is false.
Algorithm Steps
- Retrieve the optional parameters using the function
getfuncparams
. The default for colored
is true, and for RBchange
is false.
- Set the filename
fname
to 'sglib2meshlab'.
- Extract the vertex list (VL), face list (FL), and face colors (FC) from the solid geometry SG using the function
VLFLofSG
.
- If
RBchange
is true, switch the red and blue components in the face colors (A.FC) to address the Meshlab bug.
- If
colored
is false, remove the face colors field (FC) from the structure A using rmfield
.
- Write the vertex and face data to an STL file using the function
SGwriteSTL
, with the filename 'sglib2meshlab'.
- 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