LinuxCommandLibrary

stl2gts

Convert STL files to GTS format

TLDR

Convert an STL file to a GTS file

$ stl2gts < [path/to/file.stl] > [path/to/file.gts]
copy

Convert an STL file to a GTS file and revert face normals
$ stl2gts --revert < [path/to/file.stl] > [path/to/file.gts]
copy

Convert an STL file to a GTS file and do not merge vertices
$ stl2gts --nomerge < [path/to/file.stl] > [path/to/file.gts]
copy

Convert an STL file to a GTS file and display surface statistics
$ stl2gts --verbose < [path/to/file.stl] > [path/to/file.gts]
copy

Display help
$ stl2gts --help
copy

SYNOPSIS

stl2gts [OPTION...] < input.stl > output.gts

PARAMETERS

-a, --ascii
    Output GTS in human-readable ASCII format (default).

-b, --binary
    Output GTS in efficient binary format.

-c, --check
    Perform a validity check for duplicate vertices and edges in the input.

-C, --cleanup
    Attempt to remove duplicate vertices and edges from the input mesh.

-q, --quiet
    Suppress progress and status messages during conversion.

-v, --verbose
    Display detailed progress and status messages.

-h, --help
    Show a brief help message and exit.

-V, --version
    Display version information of the utility and exit.

DESCRIPTION

stl2gts is a command-line utility from the GNU Triangulated Surface (GTS) library, designed for converting three-dimensional models between file formats. Specifically, it transforms models from the Stereolithography (STL) format, a common standard for 3D printing and computer-aided design (CAD), into the GTS format.

STL files represent a 3D object's surface as a collection of unorganized triangular facets, often lacking explicit topological information like connectivity between vertices, edges, or faces. In contrast, the GTS format provides a more structured and robust representation of triangulated surfaces, explicitly defining vertices, edges, and faces, along with their connectivity. This richer topological data is crucial for advanced mesh processing tasks such as simplification, refinement, boolean operations, and finite element method (FEM) simulations.

By converting STL models to GTS, users can leverage the powerful suite of tools and algorithms available within the GTS library for comprehensive mesh analysis, manipulation, and visualization, making it an essential tool in workflows involving 3D geometry processing and scientific computing.

CAVEATS

stl2gts primarily focuses on geometric conversion. Since STL files do not inherently contain topological information (like explicit edge or face connectivity), stl2gts must infer this during conversion to the GTS format. While it includes options for checking and cleaning duplicate elements, complex or severely malformed STL inputs might still lead to sub-optimal GTS output. It typically operates using standard input and output streams, requiring shell redirection for file handling.

FILE FORMATS OVERVIEW

STL (Stereolithography): A widely adopted file format for 3D printing, CAD, and rapid prototyping. It describes a 3D object's surface as a collection of untriangulated, planar facets, with each facet defined by three vertices and a normal vector. STL files can be either ASCII or binary. Its simplicity means it lacks color, texture, or explicit topological information.

GTS (GNU Triangulated Surface): A format native to the GTS library, designed for handling complex 3D triangulated surfaces with explicit topological information. It precisely defines vertices, edges, and faces, along with their interconnections. This rich data structure enables sophisticated mesh operations and analyses not possible with simpler formats like STL, making it suitable for scientific computing and advanced 3D geometry processing.

HISTORY

stl2gts is an integral part of the GNU Triangulated Surface (GTS) Library, a free software project initiated by Stéphane Popinet. The library was developed to provide a robust and versatile set of tools for manipulating and processing 3D triangulated surfaces. Its development began in the late 1990s and early 2000s, aligning with the growing need for open-source solutions in computational geometry, scientific visualization, and numerical simulation. The command reflects the library's commitment to interoperability by supporting common 3D formats like STL.

SEE ALSO

gts(1), gtsview(1), gtscheck(1), gtsinfo(1), gtsmerge(1)

Copied to clipboard