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 [options] >

PARAMETERS

-b
    Read input file in binary STL format. If not provided, ASCII format is assumed.

-i
    Invert the normal orientation of all triangles.

-s
    Scale all vertices by the given factor .

-t
    Translate all vertices by the given translation .

-v
    Verbose output. Print additional information during the conversion process.


    The input STL file to be converted.

>
    The output file to write the GTS data to. Standard output if omitted.

DESCRIPTION

The `stl2gts` command is a utility designed to convert files in the Stereolithography (STL) format to the GTS (GNU Triangulated Surface Library) format. STL is a common file format for 3D models, widely used in CAD, 3D printing, and rapid prototyping. GTS, on the other hand, is a library for manipulating triangulated surfaces. This conversion allows you to use GTS-specific tools and algorithms to process and analyze the 3D models represented in the STL file. The conversion process involves reading the triangle data from the STL file and writing it into a GTS compatible format. It handles both ASCII and binary STL file formats. The resulting GTS output can then be used as input for other GTS-based programs for tasks like mesh simplification, surface reconstruction, or visualization.

USAGE EXAMPLE

Convert an ASCII STL file to GTS format and save it to output.gts:
stl2gts input.stl > output.gts

Convert a binary STL file to GTS format, invert the normals, and scale the model by a factor of 0.5:
stl2gts -b -i -s 0.5 input.stl > output.gts

FILE FORMAT CONSIDERATIONS

The GTS format expects properly oriented triangles. Incorrect normals in the original STL file can lead to issues in GTS-based processing. The `-i` option allows you to correct this by inverting the normal orientation. When using binary STL, ensure the file is valid to prevent errors during conversion.

SEE ALSO

gts-cat(1), gts-info(1), gts-refine(1)

Copied to clipboard