stlsolid

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

generates a STL file body from a vertex list and facet list

Description

This is an auxiliary function which is used in VLFLwriteSTL. There is no need to use it, only if bodies are written to a file sequentially.
The functions has no output parameter since it writes into a file decribed by a FID (File Identifyer)

See Also: stlxconvert , stlxprocess

Example Illustration

 missing image of stlsolid (fid, VL, FL)

Syntax

stlsolid(fid,VL,FL)

Input Parameter

fid: is the file identifyer of the file to write in, -1= screen
VL: is the given list of vertexes
FL: is the given list of facets

Examples

Building a Tetraeder
p1=[1;0;0]; p2=[1;1;0]; p3=[0;1;0]; p4=[1;1;1];
VL=[p1 p2 p3 p4]';
FL=[1 3 2; 1 4 3; 1 2 4; 2 3 4];
stlsolid (-1,VL,FL)




Copyright 2010-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, stlsolid, is designed to generate an STL file from a list of vertices and facets. It is part of the SG-Library and was created by Tim Lueth in 2010.

Input Parameters

Algorithm Steps

  1. Determine the number of facets, n, using the size of the FL matrix.
  2. Iterate over each facet from 1 to n:

The function effectively writes the STL file in ASCII format, detailing each facet's normal and vertices.

Algorithm explaination created using ChatGPT on 2025-08-18 23:50. (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