Support for the STL format for 3D models (commonly used for 3D printing)

Posted on

Knocker in STL format, by Shira, www.thingiverse.com/thing:1458545
Robot woman in the STL format, by Shira, see http://www.thingiverse.com/thing:614366
Moonkin Bust in the STL format, by bardiir, see http://www.thingiverse.com/thing:2211053

Castle Game Engine and view3dscene support now the STL format for 3D models, commonly used for 3D printing. This means that you can open these models using view3dscene, or the engine API (TCastleScene.Load), and you can convert STL files to X3D.

It’s a really simple 3D format (just vertexes with normals), and I think that the current loader (in file x3dloadinternalstl.pas) nicely serves as an example 3D file loader in our engine. It shows how to read binary and text files from a TStream instance using some helpers in our engine.

More information about the STL format is available in Wikipedia. We support both the text (ASCII) and binary formats.

Blender includes an exporter to this format.

Many sample models in the STL format, ready for 3D printing, can be downloaded e.g. from Thingiverse.

If you’d like to try it NOW in Castle Game Engine, you can download the view3dscene from snapshots. Or you can grab the source code of the engine and view3dscene from GitHub: https://github.com/castle-engine/castle-engine/ , https://github.com/castle-engine/view3dscene/.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.