GlTF
Description
The GL Transmission Format (glTF™) is a royalty-free specification for the efficient transmission and loading of 3D scenes and models by applications. It minimizes both the size of 3D assets, and the runtime processing needed to unpack and use those assets.
Importing
The Std Import command can import to the glTF format. Both binary (.glb) and textual (.gltf) formats are supported. introduced in 1.0
Alternative import workflow
The import operation is done via OCCT, FreeCAD's CAD kernel. As it is a resource-intensive task, it can take a considerable amount of time. An alternative approach is to use an external tool to reduce the amount of processing that is being done at the same time. Blender for instance has good support for .glTF and can very quickly do the first step of reading the data stream and creating a mesh object that can be further processed in FreeCAD. Or it can be directly used as a mesh without further processing.
Step 1: Conversion to STL using Blender
- Open Blender and import your source mesh file: File → Import → glTF 2.0.
- Select the imported object.
- Verify its dimensions are correct.
- Export the object via: File → Export → Stl (.stl).
- In the export options, enable Selection Only and set Scale to 1.0.
- Save the output STL file.
Step 2: Creating a Solid from STL in FreeCAD
- Import the .stl file into FreeCAD. This will create a mesh object and will be a quick operation.
- If the imported mesh is scaled incorrectly (e.g., a meters-to-millimeters error), switch to the Mesh Design Workbench, select the mesh, and use Mesh Scale to apply the necessary correction factor (e.g., 1000).
- Switch to the Part Workbench.
- Select the scaled mesh object and convert it to a shape using Part → Create shape from mesh....
- Select the new shape object and create a solid using Part → Convert to solid.
The result is a native FreeCAD solid object ready for further modeling.
Exporting
The Std Export command can export to the glTF format.
When saving a file, if the extension given by the user is .gltf, it will be saved as a two-part text filename.gltf and binary filename.bin combination. If the extension given by the user is .glb, it will be saved as one binary .glb file.
Related
User documentation
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Assembly, BIM, CAM, Draft, FEM, Inspection, Material, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework