Data Types¶
The following data types, with stl.Solid as the root, are used
to represent data read from or to be written to an STL file.
-
class
stl.Solid(name=None, facets=None)¶ A solid object; the root element of an STL file.
-
add_facet(*args, **kwargs)¶ Append a new facet to the object. Takes the same arguments as the
stl.Facettype.
-
write_ascii(file)¶ Write this object to a file in STL ascii format.
filemust be a file-like object (supporting awritemethod), to which the data will be written.
-
write_binary(file)¶ Write this object to a file in STL binary format.
filemust be a file-like object (supporting awritemethod), to which the data will be written.
-
-
class
stl.Vector3d(x, y, z)¶ Three-dimensional vector.
Used to represent both normals and vertices of
stl.Facetobjects.This is a subtype of
tuple, so can also be treated like a three-element tuple in (x,y,z) order.-
x¶ The X value of the vector, which most applications interpret as the left-right axis.
-
y¶ The Y value of the vector, which most applications interpret as the in-out axis.
-
z¶ The Z value of the vector, which most applications interpret as the up-down axis.
-