STL-IO
A Godot/GDScript addon to import/export in the STL file format.
Setup
- copy the
addons/stl-io
directory into your addons - activate it in the plugins settings.
Overview
This addon is pretty simple with 3 classes:
STLIO
has the plumbing to enable the editorSTLIO.Importer
for manual importsSTLIO.Exporter
for manual exports
Usage
In The Editor
STL files should be usable as ArrayMesh
resources as soon as the addon is activated.
Import
The importer returns either a Variant
that is either an ERROR
or an ArrayMesh
.
var mesh :ArrayMesh = STLIO.Importer.LoadFromPath('/path/to/file.stl')
STLIO.Importer.LoadFromBytes
is also available for custom use cases.
Export
The exporter exports all surfaces of an ArrayMesh
to its destination.
var mesh :ArrayMesh = ...
STLIO.Exporter.SaveToPath(mesh, '/path/to/file.stl')
STLIO.Exporter.SaveToBytes
is also available for custom use cases.
See Also
For more, check out the sample viewer.
FAQ
Q: Nice icon! A: Thanks, it comes from flaticon.com
Q: Support for colors or unofficial data in the header or the facet attr field? A: Not in this first version no. Also I lack sample data to test this, please file an issue and I'll be happy to work on it 😃
Q: Any STL resources to share? A: STLA Files, or just wikipedia.
Changelog
1.0.2
- fixed imported files in godon asset
1.0.1
- fixed tri count in exported file - now loads in selfcad and orca slicer
1.0.0
- importer & exporter ready
0.1
- first working version